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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file atradio-0.1.0.tar.gz.
File metadata
- Download URL: atradio-0.1.0.tar.gz
- Upload date:
- Size: 24.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fa8a89b789ee363b15b70ee93d9142fbf87af19e61633d4d1cc909874167132
|
|
| MD5 |
9908aeefd478b64e2f60774818b93042
|
|
| BLAKE2b-256 |
c816a31473e1049b2f4e285f80e4b59796362be90bae6543eb2d447367c3c209
|
File details
Details for the file atradio-0.1.0-py3-none-any.whl.
File metadata
- Download URL: atradio-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de1259b9b692e7ef5756dcbf50e66aa75708e57b90d5d943a574e94db2c1170f
|
|
| MD5 |
924334ea5269a6f5bf82ab2eef4c4aaa
|
|
| BLAKE2b-256 |
f52c874d64d2809e746df6dcc9511741ceeba29ad836aa3f925c867be95f6a41
|