Skip to main content

truewire-bluesky

A typed, validated, async Python client for Bluesky's AT Protocol API: profiles, posts, threads, feeds, the follow graph, handle resolution, the Jetstream firehose, and writing posts.

Generated by Truewire from a spec of what the API puts on the wire, and checked against recordings of real responses — so the types are what the API sent, not what someone remembered.

pip install truewire-bluesky

Note: PyPI has an unrelated bluesky package (NSLS-II's experiment orchestration framework) that also imports as bluesky. The two cannot share an environment.

Reading needs no account

import asyncio

from bluesky import Bluesky


async def main() -> None:
  async with Bluesky.new() as client:
    profile = await client.actor.get_profile('bsky.app')
    print(profile['handle'], profile.get('followersCount'), 'followers')

    feed = await client.feed.get_author_feed(actor='bsky.app', limit=3)
    for entry in feed['feed']:
      print(entry['post']['record']['text'][:60])


asyncio.run(main())

The firehose

Jetstream is a public WebSocket of everything happening on the network, and needs no credentials either:

async with Bluesky.new() as client:
  async with client.jetstream.events(wanted_collections=['app.bsky.feed.post']) as stream:
    async for event in stream:
      print(event['kind'], event['did'])

Writing

Needs an app password (bsky.app → Settings → App Passwords), never the account password. The client creates the session and refreshes it for you.

from datetime import datetime, timezone

from bluesky import Bluesky
from bluesky.core.richtext import post as post_record

async with Bluesky.new(identifier='you.bsky.social', app_password='xxxx-xxxx-xxxx-xxxx') as client:
  session = await client.server.create_session()
  await client.repo.create_record(
    repo=session['did'],
    collection='app.bsky.feed.post',
    record=post_record(
      'Posted from a generated client — truewire.dev',
      created_at=datetime.now(timezone.utc).isoformat().replace('+00:00', 'Z'),
      langs=['en'],
    ),
  )

post_record computes the link facets Bluesky needs to make a URL clickable, with the UTF-8 byte offsets it insists on.

Everything else

Twelve read endpoints, four write endpoints, cursor pagination on the ones that page, and TypeScript and Rust clients from the same spec.

Full documentation, the spec, and the recordings: https://github.com/truewire-dev/bluesky

MIT.

Metadata

Release files for truewire-bluesky 0.1.0

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

Source distribution (sdist)

Source distribution for truewire-bluesky 0.1.0
File Size Uploaded
truewire_bluesky-0.1.0.tar.gz 37.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for truewire-bluesky 0.1.0
File Interpreter ABI Platform
truewire_bluesky-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 80.6 kB

Release files / truewire_bluesky-0.1.0.tar.gz

Download URL truewire_bluesky-0.1.0.tar.gz
Size 37.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6c8c0329bd00f6fa7dba785f54c532e4ec62d54ad625e0d41ec45d7847c9fc3c
BLAKE2b-256 checksum
How to use checksums
e81216ac12bef8ffcb0eea528594b72324e86a47b54c777652e2db4d34291549
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

Release files / truewire_bluesky-0.1.0-py3-none-any.whl

Download URL truewire_bluesky-0.1.0-py3-none-any.whl
Size 42.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47784c8f297bf32b79ab0ed978fea5558d5e130da9fcf3df0a11260bc68ab5ae
BLAKE2b-256 checksum
How to use checksums
98e502db02c273111c372929d0d2684c819b2d695b0272eefc5ace4786fcab7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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