Skip to main content

Logo of atproto SDK for Python by Midjourney'
Autogenerated from lexicons, well type hinted, documented, sync and async SDK for Python
Documentation • Guides • Examples • Discord Bluesky API

The AT Protocol SDK

⚠️ Under construction. Until the 1.0.0 release compatibility between versions is not guaranteed.

from atproto import Client, client_utils


def main():
    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)


if __name__ == '__main__':
    main()
Code snippet of async version
import asyncio

from atproto import AsyncClient, client_utils


async def main():
    client = AsyncClient()
    profile = await 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 = await client.send_post(text)
    await client.like(post.uri, post.cid)


if __name__ == '__main__':
    asyncio.run(main())

Installing

pip install atproto

Python 3.9 or higher.

What you get

This SDK attempts to implement everything that ATProto provides. There is support for Lexicon schemas, XRPC clients, Firehose, Jetstream, Identity, DID keys, signatures, and more. All models, queries, and procedures are generated automatically. The main focus is on the lexicons of atproto.com and bsky.app, but there is no vendor lock on it. Point the code generator at your own lexicon schemas and it produces the same typed models and clients for them. The SDK also provides utilities to work with CID, NSID, AT URI schemes, DAG-CBOR, CAR files, DID documents and more.

  • Sync and async clients with identical method sets.
  • Type hints everywhere, so your IDE can navigate the whole protocol.
  • A high-level client for common tasks, with the complete XRPC surface underneath it.
  • Real-time streaming over the Firehose or Jetstream, including archive backfill.
  • Your own lexicons, compiled into an importable package by atp gen custom.

Documentation

The documentation is live at atproto.blue.

🚀 Quickstart Install, log in, post, read a timeline
📚 Guides Posting, reading, streaming, identity, errors
💡 Examples Every runnable example, inlined
🧩 Custom lexicons Generate models and clients from your own lexicons
🛠 The atp CLI The code generator's command line
💬 Direct messages Chats, messages, and reactions
🔥 Firehose & Jetstream Data streaming from the whole network
🌐 Identity DID and handle resolvers
📖 Model reference Every lexicon on the network, as a Pydantic model
🍿 Feed generator Build a custom feed, end to end

This is the SDK's documentation, not the protocol's. For the protocol itself, see atproto.com and bsky.network/docs.

SDK structure

The SDK is built upon the following components:

Package Description
atproto Import shortcuts to other packages.
atproto_cli CLI tool to generate code.
atproto_client XRPC Client, data models, and utils like rich text helper.
atproto_codegen Code generator of models, clients, and namespaces.
atproto_core Tools to work with NSID, AT URI Schemes, CID, CAR files, and DID Documents.
atproto_crypto Crypto utils like multibase, signature verification, work with DID keys.
atproto_firehose Firehose (data streaming) client and models.
atproto_identity Identity resolvers for DID, Handle, AT Protocol data, signing keys.
atproto_jetstream Jetstream v2 (data streaming) client and models.
atproto_lexicon Lexicon parser.
atproto_server Server-side utils like JWT.
atproto_subscription Websocket subscription runtime behind the streaming clients.

I highly recommend that you use the atproto package to import everything that you need. It contains shortcuts to all other packages.

Getting help

You can get help in several ways:

Change log

The full change log is available in CHANGES.md.

Contributing

Contributions of all sizes are welcome. The contribution guidelines will be presented later.

License

MIT

Metadata

Release files for atproto 0.0.74

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

Source distribution (sdist)

Source distribution for atproto 0.0.74
File Size Uploaded Provenance Actions
atproto-0.0.74.tar.gz 339.3 kB With provenance Details for atproto-0.0.74.tar.gz

Built distribution (wheel)

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

Total release size: 1.0 MB

Release files / atproto-0.0.74.tar.gz

Download URL atproto-0.0.74.tar.gz
Size 339.3 kB
Tags Source
SHA-256 checksum
How to use checksums
836770c24479229aa4bfc6e203aa8356e2c604428b9650d5d032efae3fb52048
BLAKE2b-256 checksum
How to use checksums
d9f032ea91fd6998d7a39a3782ae5267077432583bf190c1ea0f255797b07a96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / atproto-0.0.74-py3-none-any.whl

Download URL atproto-0.0.74-py3-none-any.whl
Size 702.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9aca52958542c8f3fc597265c49719ae11735274136c7008090bd0ee8ce8618
BLAKE2b-256 checksum
How to use checksums
1b622e0c01a5ff58bf7e2c183bd70f94bd47ee7078227bdcbfab19be975b91a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for atproto 0.0.74

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for atproto-0.0.74.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.74 This release

2 release files Full provenance

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