Skip to main content

Unofficial Python SDK for CloudPayments API (sync + async)

Project description

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

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

With webhook framework adapters:

uv pip install -e ".[webhooks]"

Quick Start

from cloudpayments_sdk import CloudPayments

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

Live API Tests

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

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

uv build

License

MIT (LICENSE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloudpayments_sdk-0.1.0.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloudpayments_sdk-0.1.0-py3-none-any.whl (41.8 kB view details)

Uploaded Python 3

File details

Details for the file cloudpayments_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: cloudpayments_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for cloudpayments_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ae1506e46218c6c3137b2a34dc09560b980ab601e842d922438286b68746c3cf
MD5 99813e9661d310b25416b2a1d69ab4cf
BLAKE2b-256 eb3dc7706d48f45b0762487978ad2151fb460a19001d11e78b2c38014eb84d48

See more details on using hashes here.

File details

Details for the file cloudpayments_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cloudpayments_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 361fa0bf16b5a9d6862c68a4c7a40250179e3c9fe9a93c4688539357004df812
MD5 9a45b0793d5b07eb7ca080498d306851
BLAKE2b-256 fc67675edbb3c23af00bf44532a13a60b41a00cb3b6ce14696e84a13ceecd7b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page