Metadata-Version: 2.4
Name: synora-sdk
Version: 0.1.0
Summary: Official Python SDK for Synora X402 Payment Gateway
Author-email: Synora Team <support@synora.fi>
License: MIT
Project-URL: Homepage, https://synora.fi
Project-URL: Documentation, https://synora.fi/docs
Project-URL: Repository, https://github.com/synorafi/synora-sdk
Project-URL: Bug Tracker, https://github.com/synorafi/synora-sdk/issues
Keywords: synora,x402,payment,gateway,blockchain,usdc,ai,sdk
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: web3>=6.0.0
Requires-Dist: eth-account>=0.9.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"

# Synora Python SDK

Official Python SDK for Synora X402 Payment Gateway.

## Installation

```bash
pip install synora-sdk
```

## Quick Start

```python
import asyncio
from synora import SynoraClient

async def main():
    client = SynoraClient(
        wallet_private_key="your_private_key",
        api_url="https://api.synora.io"
    )
    
    # Text analysis
    result = await client.call('/tools/analyze', {
        'text': 'What is the sentiment of this text?',
        'model': 'gpt-4'
    })
    print(result)
    
    # OCR
    ocr_result = await client.call('/tools/ocr', {
        'image_url': 'https://example.com/image.png'
    })
    print(ocr_result)

if __name__ == '__main__':
    asyncio.run(main())
```

## Features

- ✅ Async/await support
- ✅ Automatic retry with exponential backoff
- ✅ Type hints
- ✅ Comprehensive error handling
- ✅ Payment caching

## API Reference

### SynoraClient

```python
class SynoraClient:
    def __init__(
        self,
        wallet_private_key: str,
        api_url: str = "https://api.synora.io",
        max_retries: int = 3,
        timeout: int = 30
    )
```

### Methods

#### call(endpoint: str, data: dict) -> dict

Make an API call with automatic payment handling.

```python
result = await client.call('/tools/analyze', {
    'text': 'Hello world',
    'model': 'gpt-4'
})
```

#### get_balance() -> float

Get current USDC balance.

```python
balance = await client.get_balance()
print(f"Balance: ${balance}")
```

## Examples

See [examples](../../examples/python/) directory.

## Requirements

- Python 3.7+
- aiohttp
- web3
- eth-account
