Metadata-Version: 2.4
Name: cloudpayments-sdk
Version: 0.1.0
Summary: Unofficial Python SDK for CloudPayments API (sync + async)
Author: CloudPayments SDK Maintainers
License-Expression: MIT
Project-URL: Homepage, https://developers.cloudpayments.ru/
Project-URL: Documentation, https://developers.cloudpayments.ru/
Keywords: cloudpayments,payments,api,sdk,python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.25
Requires-Dist: pydantic>=2.5
Requires-Dist: typing-extensions>=4.8
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: mypy>=1.7; extra == "dev"
Requires-Dist: ruff>=0.5.0; extra == "dev"
Requires-Dist: types-requests; extra == "dev"
Requires-Dist: twine>=5.1.1; extra == "dev"
Provides-Extra: webhooks
Requires-Dist: fastapi>=0.110; extra == "webhooks"
Requires-Dist: flask>=3.0; extra == "webhooks"
Requires-Dist: django>=4.2; extra == "webhooks"
Dynamic: license-file

# CloudPayments SDK

Python SDK for CloudPayments API with sync/async clients, typed response models, retry middleware, and webhook utilities.

## Features

- Sync and async clients (`CloudPayments`, `AsyncCloudPayments`)
- Resource-oriented API (`payments`, `orders`, `subscriptions`, `notifications`, `claims`, `payouts`)
- Pydantic v2 models with tolerant parsing (`extra="allow"`)
- Retry middleware for transient network/rate-limit errors
- Webhook signature verification and event parsing
- Optional framework adapters: FastAPI, Flask, Django

## Installation

```bash
uv venv
source .venv/bin/activate
uv pip install -e ".[dev]"
```

With webhook framework adapters:

```bash
uv pip install -e ".[webhooks]"
```

## Quick Start

```python
from cloudpayments_sdk import CloudPayments

with CloudPayments(public_id="pk_...", api_secret="...") as client:
    assert client.test() is True
```

## Live API Tests

```bash
export CLOUDPAYMENTS_RUN_LIVE=1
export CLOUDPAYMENTS_PUBLIC_ID="pk_..."
export CLOUDPAYMENTS_API_SECRET="..."
export CLOUDPAYMENTS_IP_ADDRESS="$(curl -4 https://api.ipify.org)"

uv run --extra dev pytest -q -m live -s
```

## Local Checks

```bash
uv run --extra dev ruff check cloudpayments_sdk tests examples
uv run --extra dev mypy cloudpayments_sdk
uv run --extra dev pytest -q
```

## Examples

- `python -m examples.sync_basic`
- `python -m examples.async_basic`
- `python -m examples.e2e_token_subscription`
- `python -m examples.webhook_fastapi`

Detailed usage: `docs/examples.md`  
API method list: `docs/reference.md`

## Build

```bash
uv build
```

## License

MIT (`LICENSE`).
