The AT Protocol SDK for Python
Autogenerated from lexicons, well type hinted, documented, sync and async.
from atproto import Client, client_utils
client = Client()
profile = client.login('my-handle', 'my-password')
print('Welcome,', profile.display_name)
text = client_utils.TextBuilder().text('Hello World from ').link('Python SDK', 'https://atproto.blue')
post = client.send_post(text)
client.like(post.uri, post.cid)
pip install atproto
Warning
Under construction. Until the 1.0.0 release, compatibility between versions is not guaranteed.
Where to start
Install it, log in, send a post, read a timeline. Five minutes.
Posting, reading, streaming, identity and error handling, organised by what you are trying to do.
Every runnable example in the repository, inlined and ready to copy.
Generate typed models and a working client from lexicons of your own. No fork required.
Consume the whole networkβs event stream, verifiable or cheap.
Every lexicon on the network, generated as a Pydantic model and browsable by NSID.
What it covers
This SDK implements what the AT Protocol provides: lexicon schemas, XRPC clients, the firehose, Jetstream, identity resolution, DID keys, signatures, and the utilities around CIDs, NSIDs, AT-URIs, DAG-CBOR, CAR files, and DID documents.
Every model, query, and procedure is generated from lexicons. The focus is on the lexicons of atproto.com and bsky.app, but there is no vendor lock: point the code generator at your own and it produces the same typed models and clients for them.
Sync and async clients with identical method sets
Type hints throughout, so your IDE can navigate the whole protocol
A high-level client for common tasks, with the full XRPC surface underneath it
Direct messages, firehose and Jetstream streaming, and identity resolvers
Not the protocol documentation
This site documents the Python SDK. For the protocol itself, meaning what a DID is, how repositories and the Merkle tree work, the lexicon language and OAuth, go to the source:
atproto.com: the protocol guides and specifications
bsky.network/docs: the Bluesky API, rate limits, and the network services
Glossary: the canonical definitions
Concepts is a short bridge between that vocabulary and the names you will see in this SDK.
Getting help
Open an issue to report a bug or request a feature
Start a discussion to ask a question
π Getting started
π Guides
π‘ Examples
π CLI & code generation
π Clients
π‘ Firehose & Jetstream
π§± Advanced