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.
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
- Clone the repository:
git clone https://github.com/CCXLV/paddle.py.git
cd paddle.py
- 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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file paddle_py-0.1.3.tar.gz.
File metadata
- Download URL: paddle_py-0.1.3.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91f8f4f1d5319b4e6cf342bb291407b6dde5f4caa3236450a697168c9ab4c857
|
|
| MD5 |
354d9507fca2237d6e82c0d4a9cc8179
|
|
| BLAKE2b-256 |
3ff5d7d9e2ab263940d89dcbf44874a6a33a1d60847632c86e0486d218221eb4
|
File details
Details for the file paddle_py-0.1.3-py3-none-any.whl.
File metadata
- Download URL: paddle_py-0.1.3-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.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c22827d0c293d42afbb59dace328d3dedefa56102c4d8d5d56eb0183a19c5ed2
|
|
| MD5 |
b2fe1ae4f3f98b11678b3989d224975a
|
|
| BLAKE2b-256 |
40264a6ead9f3b85d541018f59a9106fd40b020e321935bd2142d4132f372a6a
|