Installation
pip install atproto
Python 3.9 or newer is required.
That single package pulls in everything: the XRPC clients, the generated models for every lexicon the network publishes, the firehose and Jetstream clients, the identity resolvers, the crypto and JWT helpers, and the atp code generator.
Verify it
python -c "import atproto; print(atproto.__version__)"
atp --help
What you actually installed
The distribution is one PyPI package built from several importable ones. You rarely need to know this, since from atproto import ... re-exports what the others provide, but it explains the module paths you will see in tracebacks and in this documentation.
Package |
What lives there |
|---|---|
|
Import shortcuts to everything below. Import from here. |
|
The XRPC clients, generated models, namespaces, and the rich text builder. |
|
NSID, AT-URI, CID, CAR files, DAG-CBOR, DID documents. |
|
Handle and DID resolvers, with caching. |
|
Multibase, |
|
Server-side helpers, notably JWT verification. |
|
The websocket subscription runtime the streaming clients are built on. |
|
The firehose clients and their deployment defaults. |
|
The Jetstream v2 client and its archive replay. |
|
The lexicon parser. |
|
The code generator. |
|
The |
Tip
Import from atproto rather than from the individual packages. It is the stable surface, and it saves you from tracking which package a name currently lives in.
from atproto import AsyncClient, CAR, Client, IdResolver, client_utils, models
Pinning
The SDK is pre-1.0 and does not guarantee compatibility between versions yet. Pin it:
atproto~=0.1
This matters more than usual if you generate code from custom lexicons: generated packages are only guaranteed to work with the SDK version that produced them.
Optional extras
Ruff is needed only if you run the code generator. It is deliberately not a dependency:
pip install ruff
Next
Quickstart: log in and send a post.
Guides: the task-oriented documentation.
Examples: every runnable example in the repository.