Python SDK
drazill — sync and async clients with retries, idempotency, cursor iteration, and a WebSocket client.
The drazill package is generated from the contract and MIT-licensed. Requires Python
3.9+.
Install
An unconfigured client talks to staging (https://staging.drazill.com/api/v1), never
production — pass base_url= or set DRAZILL_BASE_URL to target another environment.
Quickstart
Point the client at an environment with DRAZILL_BASE_URL (defaults to staging). List open
markets:
This is lifted verbatim from the tested example sdks/python/examples/quickstart_markets.py.
See Quickstart for the full first-call → paper-trade walkthrough.
Place an order idempotently
Preview a fee-inclusive quote, then place the order binding the quote token and an application-owned idempotency key, so a client-side retry hits the server’s replay guarantee instead of double-placing:
Retries
Configure the retry budget on the client; it retries 5xx and 429, honouring Retry-After:
Cursor pagination
For endpoints on the signed-cursor envelope, use the exported iterators rather than managing
X-Next-Cursor yourself — pass a bound resource method and its params and iterate items
directly (see the SDK README’s pagination section). Details in
Pagination and the API Reference.
WebSocket
Install the [websocket] extra, then connect, subscribe, and listen. Subscribe to
prices:{outcome_id} for price ticks, orderbook:{outcome_id} for depth, and
trades:{market_id} for the tape:
Verify webhooks
Verify the signature on every inbound webhook before trusting it, then construct the typed event:
The full webhook contract (signing, retries, replay) is under Webhooks.
Request signing
If your key requires HMAC signing, sign "<unix_ts>.<METHOD>.<path>." + body and send the
timestamp + signature headers (Authentication):

