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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atproto-0.0.72.tar.gz (299.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atproto-0.0.72-py3-none-any.whl (623.2 kB view details)

Uploaded Python 3

File details

Details for the file atproto-0.0.72.tar.gz.

File metadata

  • Download URL: atproto-0.0.72.tar.gz
  • Upload date:
  • Size: 299.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for atproto-0.0.72.tar.gz
Algorithm Hash digest
SHA256 eec904188b0beba165a7cc14ccc6a190b3ce061fecac4db3b9166e2500b02a41
MD5 cdc38649d53ad3bda95e429c65b946b7
BLAKE2b-256 c6549b365b712ae0e98af668af743a5411a7be44232ab0bec3f88e88f560304d

See more details on using hashes here.

Provenance

The following attestation bundles were made for atproto-0.0.72.tar.gz:

Publisher: publish_release.yml on MarshalX/atproto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file atproto-0.0.72-py3-none-any.whl.

File metadata

  • Download URL: atproto-0.0.72-py3-none-any.whl
  • Upload date:
  • Size: 623.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for atproto-0.0.72-py3-none-any.whl
Algorithm Hash digest
SHA256 239ca1c54cb4c878f625581b44abd1f0018b7b55419f7ca886468641ecb7fb09
MD5 4b2c1959509f665e26ca97119d90f43a
BLAKE2b-256 280135eb989f870b2e152d5fe7384224a28d82b2d010bf9bb45b07e06966bddd

See more details on using hashes here.

Provenance

The following attestation bundles were made for atproto-0.0.72-py3-none-any.whl:

Publisher: publish_release.yml on MarshalX/atproto

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.72 This release

2 files

0.0.71

2 files

0.0.70

2 files

0.0.69

2 files

0.0.68

2 files

0.0.67

2 files

0.0.66

2 files

0.0.65

2 files

0.0.64

2 files

0.0.63

2 files

0.0.62

2 files

0.0.61

2 files

0.0.60

2 files

0.0.59

2 files

0.0.58

2 files

0.0.57

2 files

0.0.56

2 files

0.0.55

2 files

0.0.54

2 files

0.0.53

2 files

0.0.52

2 files

0.0.51

2 files

0.0.50

2 files

0.0.49

2 files

0.0.48

2 files

0.0.47

2 files

0.0.46

2 files

0.0.45

2 files

0.0.44

2 files

0.0.43

2 files

0.0.42

2 files

0.0.41

2 files

0.0.40

2 files

0.0.39

2 files

0.0.38

2 files

0.0.37

2 files

0.0.36

2 files

0.0.35

2 files

0.0.34

2 files

0.0.33

2 files

0.0.32

2 files

0.0.31

2 files

0.0.30

2 files

0.0.29

2 files

0.0.28

2 files

0.0.27

2 files

0.0.26

2 files

0.0.25

2 files

0.0.24

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

2 files

0.0.19

2 files

0.0.18

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

0.0.13

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 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