chitose


Namechitose JSON
Version 0.0.10 PyPI version JSON
download
home_pagehttps://github.com/mnogu/chitose
SummaryA client library for the AT Protocol (Bluesky)
upload_time2023-07-17 14:52:08
maintainer
docs_urlNone
authorMuneyuki Noguchi
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements websockets
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Chitose

[![Python](https://img.shields.io/pypi/pyversions/chitose.svg)](https://badge.fury.io/py/chitose)
[![PyPI](https://badge.fury.io/py/chitose.svg)](https://badge.fury.io/py/chitose)
[![Read the Docs](https://readthedocs.org/projects/chitose/badge/?version=latest&style=flat)](https://chitose.readthedocs.io/en/latest/)

Chitose is a Python client library for the AT Protocol (Bluesky).

## Usage

The API of Chitose is similar to [the ATP API](https://github.com/bluesky-social/atproto/blob/main/packages/api/README.md).

For example, you can use `get_timeline()` in `BskyAgent` to get the timeline as shown below. Replace `YOUR_USERNAME` and `YOUR_PASSWORD` with your username and your password respectively:

```
$ git clone https://github.com/mnogu/chitose.git
$ cd chitose
$ python3 -m pip install -r requirements.txt
$ python3
>>> from chitose import BskyAgent
>>> agent = BskyAgent(service='https://bsky.social')
>>> agent.login(identifier='YOUR_USERNAME', password='YOUR_PASSWORD')
>>> agent.get_timeline(limit=1)
```
For available methods in `BskyAgent`, refer to [the documentation of `BskyAgent`](https://chitose.readthedocs.io/en/latest/chitose.html#chitose.BskyAgent).

Alternatively, you can use `app.bsky.feed.get_timeline()` as in [the advanced API calls](https://github.com/bluesky-social/atproto/blob/main/packages/api/README.md#advanced-api-calls):

```
$ git clone https://github.com/mnogu/chitose.git
$ cd chitose
$ python3 -m pip install -r requirements.txt
$ python3
>>> from chitose import BskyAgent
>>> agent = BskyAgent(service='https://bsky.social')
>>> agent.login(identifier='YOUR_USERNAME', password='YOUR_PASSWORD')
>>> agent.app.bsky.feed.get_timeline(limit=1)
```

You can also post with `com.atproto.repo.create_record()`:
```python
from datetime import datetime
from datetime import timezone
from chitose import BskyAgent
from chitose.app.bsky.feed.post import Post

agent = BskyAgent(service='https://example.com')
agent.login(identifier='alice@mail.com', password='hunter2')

record = Post(text='Hello, world!',
              created_at=datetime.now(timezone.utc).isoformat())
agent.com.atproto.repo.create_record(
    repo=alice.did, collection='app.bsky.feed.post', record=record)
```

See also the [`examples`](https://github.com/mnogu/chitose/tree/main/examples) directory for sample code.

## Documentation

For all the functions and classes available in Chitose, refer to [the Chitose’s documentation](https://chitose.readthedocs.io/en/latest/).

## Install

While you can use Chitose without installing its Python package, you can install [the package](https://pypi.org/project/chitose/):
```
$ python3 -m pip install chitose
```

Alternatively, you can build a Python package and install it:
```
$ git clone https://github.com/mnogu/chitose.git
$ cd chitose
$ python3 -m pip install -r requirements.txt
$ python3 -m pip install --upgrade build
$ python3 -m build
$ python3 -m pip install dist/chitose-*-py3-none-any.whl
```

## Generating Code

Most source files of Chitose are generated from the Lexicon files in the `atproto` directory, and you can generate Python code from these files by yourself:
```
$ git clone --recursive https://github.com/mnogu/chitose.git
$ cd chitose
$ python3 generate.py
```

You can also update the `atproto` directory and regenerate Python code:
```
$ git submodule update --remote atproto
$ python3 generate.py
```

You may want to add new Python code to the repository or update the documentation:
```
$ git add chitose
$ git commit
```
```
$ python3 -m pip install -r docs/source/requirements.txt
$ cd docs
$ sphinx-apidoc -o ./source ../chitose -f
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mnogu/chitose",
    "name": "chitose",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "Muneyuki Noguchi",
    "author_email": "nogu.dev@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/10/e6/8fd86f2fac7e18c9dee515354bd0befeae09191210dd17b79d1637d0c9ed/chitose-0.0.10.tar.gz",
    "platform": null,
    "description": "# Chitose\n\n[![Python](https://img.shields.io/pypi/pyversions/chitose.svg)](https://badge.fury.io/py/chitose)\n[![PyPI](https://badge.fury.io/py/chitose.svg)](https://badge.fury.io/py/chitose)\n[![Read the Docs](https://readthedocs.org/projects/chitose/badge/?version=latest&style=flat)](https://chitose.readthedocs.io/en/latest/)\n\nChitose is a Python client library for the AT Protocol (Bluesky).\n\n## Usage\n\nThe API of Chitose is similar to [the ATP API](https://github.com/bluesky-social/atproto/blob/main/packages/api/README.md).\n\nFor example, you can use `get_timeline()` in `BskyAgent` to get the timeline as shown below. Replace `YOUR_USERNAME` and `YOUR_PASSWORD` with your username and your password respectively:\n\n```\n$ git clone https://github.com/mnogu/chitose.git\n$ cd chitose\n$ python3 -m pip install -r requirements.txt\n$ python3\n>>> from chitose import BskyAgent\n>>> agent = BskyAgent(service='https://bsky.social')\n>>> agent.login(identifier='YOUR_USERNAME', password='YOUR_PASSWORD')\n>>> agent.get_timeline(limit=1)\n```\nFor available methods in `BskyAgent`, refer to [the documentation of `BskyAgent`](https://chitose.readthedocs.io/en/latest/chitose.html#chitose.BskyAgent).\n\nAlternatively, you can use `app.bsky.feed.get_timeline()` as in [the advanced API calls](https://github.com/bluesky-social/atproto/blob/main/packages/api/README.md#advanced-api-calls):\n\n```\n$ git clone https://github.com/mnogu/chitose.git\n$ cd chitose\n$ python3 -m pip install -r requirements.txt\n$ python3\n>>> from chitose import BskyAgent\n>>> agent = BskyAgent(service='https://bsky.social')\n>>> agent.login(identifier='YOUR_USERNAME', password='YOUR_PASSWORD')\n>>> agent.app.bsky.feed.get_timeline(limit=1)\n```\n\nYou can also post with `com.atproto.repo.create_record()`:\n```python\nfrom datetime import datetime\nfrom datetime import timezone\nfrom chitose import BskyAgent\nfrom chitose.app.bsky.feed.post import Post\n\nagent = BskyAgent(service='https://example.com')\nagent.login(identifier='alice@mail.com', password='hunter2')\n\nrecord = Post(text='Hello, world!',\n              created_at=datetime.now(timezone.utc).isoformat())\nagent.com.atproto.repo.create_record(\n    repo=alice.did, collection='app.bsky.feed.post', record=record)\n```\n\nSee also the [`examples`](https://github.com/mnogu/chitose/tree/main/examples) directory for sample code.\n\n## Documentation\n\nFor all the functions and classes available in Chitose, refer to [the Chitose\u2019s documentation](https://chitose.readthedocs.io/en/latest/).\n\n## Install\n\nWhile you can use Chitose without installing its Python package, you can install [the package](https://pypi.org/project/chitose/):\n```\n$ python3 -m pip install chitose\n```\n\nAlternatively, you can build a Python package and install it:\n```\n$ git clone https://github.com/mnogu/chitose.git\n$ cd chitose\n$ python3 -m pip install -r requirements.txt\n$ python3 -m pip install --upgrade build\n$ python3 -m build\n$ python3 -m pip install dist/chitose-*-py3-none-any.whl\n```\n\n## Generating Code\n\nMost source files of Chitose are generated from the Lexicon files in the `atproto` directory, and you can generate Python code from these files by yourself:\n```\n$ git clone --recursive https://github.com/mnogu/chitose.git\n$ cd chitose\n$ python3 generate.py\n```\n\nYou can also update the `atproto` directory and regenerate Python code:\n```\n$ git submodule update --remote atproto\n$ python3 generate.py\n```\n\nYou may want to add new Python code to the repository or update the documentation:\n```\n$ git add chitose\n$ git commit\n```\n```\n$ python3 -m pip install -r docs/source/requirements.txt\n$ cd docs\n$ sphinx-apidoc -o ./source ../chitose -f\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A client library for the AT Protocol (Bluesky)",
    "version": "0.0.10",
    "project_urls": {
        "Documentation": "https://chitose.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/mnogu/chitose",
        "Repository": "https://github.com/mnogu/chitose"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c0ad01230787069f9a6aaca57c2cd4a1dbf868392c838e5aef8a8038a8c61663",
                "md5": "c7d769cb41154e98ccc0a95ad69d89a7",
                "sha256": "e65491ae35bbe8dd6a13d1e06be306a4d5a2447c58dde8efbe18c90197dbc85f"
            },
            "downloads": -1,
            "filename": "chitose-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c7d769cb41154e98ccc0a95ad69d89a7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 86513,
            "upload_time": "2023-07-17T14:52:07",
            "upload_time_iso_8601": "2023-07-17T14:52:07.281019Z",
            "url": "https://files.pythonhosted.org/packages/c0/ad/01230787069f9a6aaca57c2cd4a1dbf868392c838e5aef8a8038a8c61663/chitose-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "10e68fd86f2fac7e18c9dee515354bd0befeae09191210dd17b79d1637d0c9ed",
                "md5": "ff527250d6ae89a0bd170b02c71d7f8f",
                "sha256": "5f6264bd7c989840cd955dcc665aafda6e26182a07552f66c00aee5d3caa4a58"
            },
            "downloads": -1,
            "filename": "chitose-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "ff527250d6ae89a0bd170b02c71d7f8f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 30239,
            "upload_time": "2023-07-17T14:52:08",
            "upload_time_iso_8601": "2023-07-17T14:52:08.678623Z",
            "url": "https://files.pythonhosted.org/packages/10/e6/8fd86f2fac7e18c9dee515354bd0befeae09191210dd17b79d1637d0c9ed/chitose-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-17 14:52:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mnogu",
    "github_project": "chitose",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "websockets",
            "specs": [
                [
                    ">=",
                    "11.0"
                ]
            ]
        }
    ],
    "lcname": "chitose"
}
        
Elapsed time: 0.20136s