Skip to main content

Chitose

Python PyPI Read the Docs

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

Usage

The API of Chitose is similar to the ATP API.

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.

Alternatively, you can use app.bsky.feed.get_timeline() as in the 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():

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 directory for sample code.

Documentation

For all the functions and classes available in Chitose, refer to the Chitose’s documentation.

Install

While you can use Chitose without installing its Python package, you can install the package:

$ 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

Release files for chitose 0.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chitose 0.0.11
File Size Uploaded
chitose-0.0.11.tar.gz 33.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chitose 0.0.11
File Interpreter ABI Platform
chitose-0.0.11-py3-none-any.whl Python 3 none any Details

Total release size:128.3 kB

Release files / chitose-0.0.11.tar.gz

Download URL chitose-0.0.11.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
218b8d89cb4fc50011ce4c5d86882dce25f97b957e76ae5b67abeae0f3a701f8
BLAKE2b-256 checksum
How to use checksums
157b279889e4fd4f9748bf90396b7f1ddb10838f70c7c27dbf0b7a2c4337c1b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release files / chitose-0.0.11-py3-none-any.whl

Download URL chitose-0.0.11-py3-none-any.whl
Size 95.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4c8251655f6472684129f5692d67f56732050f2f5cd58a948a98b425cca8fbe
BLAKE2b-256 checksum
How to use checksums
7bf5ef8d3091ea8d9351da4a70cd0649f9fd6397d01d0b9bebc302de7e05e3c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.18

Release history Release notifications | RSS feed

This release

0.0.11 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page