Skip to main content
rocksky is an async-first, typed Python client for the Rocksky API.
  • Built on asyncio + httpx.AsyncClient
  • Pydantic v2 models for every common entity
  • Resource-style namespaces (client.actor, client.scrobble, …)
  • Escape hatch via client.call(method) for un-wrapped XRPC methods
  • Works on Python 3.10+

Install

Quick start

Authenticating

Swap tokens mid-session:

Self-hosting / custom base URL

Builder

  • Every setter returns self, so chain freely.
  • Hooks may be sync or async — the SDK awaits when needed.
  • retries(n) retries TransportError + any 5xx response with exponential backoff (backoff * 2**attempt). 4xx surfaces immediately.

IPython autoawait

Resources

Escape hatch

Errors

APIError exposes status_code, method, error, message, and body.

Testing

Types

Public model types are derived from the Rocksky lexicons and live in rocksky.gen.models (Pydantic) and rocksky.gen.types (dataclasses). rocksky.models re-exports the Pydantic shapes under their historical SDK names. Regenerate with bun run lexgen:types at the repo root.

License

MIT © Tsiry Sandratraina. Source: sdk/python.