> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ticksupply.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Python SDK

> Official Python client for the Ticksupply API — sync and async, with auto-pagination and typed errors

The official Python client supports both synchronous and asynchronous usage.

<CardGroup cols={2}>
  <Card title="PyPI" icon="python" href="https://pypi.org/project/ticksupply/">
    pip install ticksupply
  </Card>

  <Card title="GitHub" icon="github" href="https://github.com/Ticksupply/ticksupply-python">
    Source code and documentation
  </Card>
</CardGroup>

## Install

```bash theme={"system"}
pip install ticksupply
```

## Quick example

```python theme={"system"}
from ticksupply import Client

client = Client(api_key="your_api_key")

# List exchanges
for exchange in client.exchanges.list():
    print(f"{exchange.code}: {exchange.display_name}")

# Create a subscription
sub = client.subscriptions.create(datastream_id=123)
print(f"Subscription: {sub.id}")
```

## Features

* **Sync and async** — `Client` for synchronous code, `AsyncClient` for `asyncio`
* **Automatic retries** — Retries on transient errors with exponential backoff
* **Auto-pagination** — `list_all()` iterators handle pagination automatically
* **Typed models** — Full type hints with Pydantic v2 models
* **Error handling** — Typed exceptions (`NotFoundError`, `RateLimitError`, etc.)

## Requirements

* Python 3.10+

<Tip>
  See the [Python examples](/examples/python) page for complete usage examples.
</Tip>
