Something went wrong. Try again.
A social internet radio platform built on AT Protocol. atradio.fm
atproto radio
Something went wrong. Try again.
README.md
atradio (Python SDK) #
The official Python SDK for atradio.fm. It's a thin
UniFFI binding to the shared Rust core
(atradio-sdk), so the auth / record / reconcile logic is byte-for-byte the same
as the Rust, Go, and TypeScript SDKs.
Setup (uv) #
The native library + generated module are build artifacts. Build them once, then
use uv:
cd sdk/python
./build.sh # cargo build + uniffi-bindgen + copy the native lib
uv run examples/smoke.py
Interactive console (IPython) #
Play with the SDK in a REPL. av (an unauthenticated AppView) plus AppView,
Agent, and favorite_rkey are pre-imported:
uv run --group console console.py
In [1]: av.recent_stations(3)
In [2]: favorite_rkey("rb:...")
Usage #
from atradio import AppView, Agent, favorite_rkey
# Reads — unauthenticated.
av = AppView()
for s in av.recent_stations(10):
print(s.station.name)
# Writes — app-password login (persists a session file).
agent = Agent.login_password("session.json", "alice.bsky.social", "app-password")
agent.favorite(station) # idempotent — deterministic record key
agent.set_play_status(station)
# The favorite record key matches every other atradio SDK.
favorite_rkey("rb:...") # 16-char hex
Layout #
crates/atradio-uniffi(Rust) — the UniFFI core: a sync facade over the asyncatradio-sdk, driving a tokio runtime.build.shregeneratessrc/atradio/atradio_uniffi.py+ the native library.src/atradio/__init__.pyre-exports the generated bindings as theatradiopackage.