A modern Python SDK for Paddle's API with type hints and async support
Project description
Paddle SDK
A modern Python SDK for Paddle's API with type hints and async support.
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-sdk
Quick Start
Synchronous Client
from paddle import Client, Environment
# Initialize the client
client = Client(
api_key="your-api-key",
environment=Environment.SANDBOX # or Environment.PRODUCTION
)
# List products
products = client.product.list()
print(products)
# Get a specific product
product = client.product.get(product_id="pro_123")
print(product)
Asynchronous Client
import asyncio
from paddle.aio import AsyncClient
from paddle.environment 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.product.list()
print(all_products)
# Get a product
product = await client.product.get(initial_product.data.id)
print(product)
if __name__ == "__main__":
asyncio.run(main())
Development
Setup
- Clone the repository:
git clone https://github.com/CCXLV/paddle-sdk.git
cd paddle-sdk
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
paddle_sdk-0.1.2b1.tar.gz
(20.6 kB
view details)
Built Distribution
File details
Details for the file paddle_sdk-0.1.2b1.tar.gz
.
File metadata
- Download URL: paddle_sdk-0.1.2b1.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
db9add13c08b650cbc280833da53369f0e16ce09d325900e5a3a558208a56d1c
|
|
MD5 |
acdd03232699141984f48bfdc8e4c5af
|
|
BLAKE2b-256 |
44d1f2725eb4c5a4b941e70fb20d7c1c3892c39d224fb34434af410655a0ae88
|
File details
Details for the file paddle_sdk-0.1.2b1-py3-none-any.whl
.
File metadata
- Download URL: paddle_sdk-0.1.2b1-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b9c85bef157e459dd77bd0eb9936998f2ac12fb441bc2b578ac5e46778573703
|
|
MD5 |
9000a3c1f785df17a54ea525905bc5f9
|
|
BLAKE2b-256 |
4f25c04eca2ecb1916309ee4f4b81285fd833a6a2495e4a8194e9e87179b6b5b
|