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

# Python SDK

> Official TXCloud SDK for Python

## Installation

```bash theme={null}
pip install txcloud
```

## Quick Start

```python theme={null}
from txcloud import TXCloud
import os

txcloud = TXCloud(api_key=os.environ.get("TXCLOUD_API_KEY"))

verification = txcloud.identity.verify(
    document_front=document_base64,
    country="MA",
    document_type="national_id"
)

print(verification.status)
```

## Configuration

```python theme={null}
txcloud = TXCloud(
    api_key="txc_live_xxx",
    environment="production",  # or "sandbox"
    timeout=30,
    max_retries=3
)
```

## Async Support

```python theme={null}
from txcloud import AsyncTXCloud
import asyncio

async def main():
    txcloud = AsyncTXCloud(api_key=os.environ["TXCLOUD_API_KEY"])
    verification = await txcloud.identity.verify(...)
    print(verification.status)

asyncio.run(main())
```

## Error Handling

```python theme={null}
from txcloud.exceptions import (
    TXCloudError,
    ValidationError,
    RateLimitError
)

try:
    result = txcloud.identity.verify(...)
except ValidationError as e:
    print(f"Validation failed: {e.message}")
except RateLimitError as e:
    print(f"Rate limited, retry after: {e.retry_after}")
except TXCloudError as e:
    print(f"API error: {e.code}")
```

## Type Hints

Full type hints for IDE support:

```python theme={null}
from txcloud.types import Verification, VerifyRequest

request: VerifyRequest = {
    "document_front": "...",
    "country": "MA"
}

verification: Verification = txcloud.identity.verify(**request)
```
