Skip to main content

A modern Python API wrapper for Paddle's API with type hints and async support

Project description

Paddle SDK

A modern Python API wrapper for Paddle's API with type hints and async support.

License: MIT Python Version Code style: black

Features

  • 🚀 Synchronous and asynchronous client implementations
  • 📦 Support for Paddle's API (in development)
  • 🧩 Type hints throughout the codebase
  • 🔄 Automatic retry mechanism for failed requests
  • 🔧 Environment configuration (Sandbox/Production)
  • 🛡️ Comprehensive error handling
  • 📊 Extensive test coverage

Installation

pip install paddle.py

Quick Start

Synchronous Client

from paddle import Client, Environment

# Initialize the client
client = Client(
    api_key="API_KEY",
    environment=Environment.SANDBOX  # or Environment.PRODUCTION
)

# List products
products = client.products.list()
print(products)

# Get a specific product
product = client.products.get(product_id="pro_123456789")
print(product)

Asynchronous Client

import asyncio

from paddle.aio import AsyncClient
from paddle import Environment


async def main():
    async with AsyncClient(
        api_key="API_KEY",
        environment=Environment.SANDBOX,  # or Environment.PRODUCTION
    ) as client:
        # List products
        all_products = await client.products.list()
        print(all_products)

        # Get a product
        product = await client.products.get("pro_123456789")
        print(product)


if __name__ == "__main__":
    asyncio.run(main())

Development

Setup

  1. Clone the repository:
git clone https://github.com/CCXLV/paddle.py.git
cd paddle.py
  1. Create a virtual environment:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install development dependencies:
pip install -e .[dev]

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=paddle

Contributing

For detailed information on how to contribute to this project, please see our Contributing Guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Roadmap

See the CHANGELOG.md for planned API endpoints and features.

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

paddle_py-0.1.1.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

paddle_py-0.1.1-py3-none-any.whl (44.1 kB view details)

Uploaded Python 3

File details

Details for the file paddle_py-0.1.1.tar.gz.

File metadata

  • Download URL: paddle_py-0.1.1.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for paddle_py-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3e736581c1b6e2e255b94cd6a658fc46d698ea59621c021d36d4eaa34261d846
MD5 e8ee556e34e928a25574fcce0a621ac3
BLAKE2b-256 6be406e1edf4b7a6992a39eba2cacf33ad560caaba18768d97ada16777bf3e13

See more details on using hashes here.

File details

Details for the file paddle_py-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: paddle_py-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 44.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for paddle_py-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a5682d1e264d54670866f6e0a4fa25bb0238f7fc2ccd16ff1df4c38cfa2e50ce
MD5 e44db12d8bbbfb00111a5e99739d0b43
BLAKE2b-256 e60865523d5d0f61c1e990c89d5550b24758f77c1866574d7c1d90f3d7e41103

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