ChiefPay Python SDK
Project description
ChiefPay SDK
This is the official Python SDK for interacting with the ChiefPay payment system.
Installation
pip install chiefpay
Usage
Synchronous Client
from chiefpay import Client
client = Client(api_key="your_api_key")
rates = client.get_rates()
print("Exchange rates:", rates)
Asynchronous Client
import asyncio
from chiefpay import AsyncClient
async def main():
client = AsyncClient(api_key="your_api_key")
rates = await client.get_rates()
print("Exchange rates:", rates)
asyncio.run(main())
WebSocket Client
from chiefpay import SocketClient
def on_notification(data):
print("New notification:", data)
with SocketClient(api_key="your_api_key") as client:
client.set_on_notification(on_notification)
input("Press Enter to exit...")
Asynchronous WebSocket Client
import asyncio
from chiefpay import AsyncSocketClient
async def on_notification(data):
print("New notification:", data)
async def main():
async with AsyncSocketClient(api_key="your_api_key") as client:
client.set_on_notification(on_notification)
print("Asynchronous WebSocket client started. Waiting for events...")
await asyncio.sleep(60)
asyncio.run(main())
Examples
For comprehensive examples, including advanced use cases, check out the examples directory
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
chiefpay-1.2.0.tar.gz
(9.5 kB
view details)
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
chiefpay-1.2.0-py3-none-any.whl
(14.8 kB
view details)
File details
Details for the file chiefpay-1.2.0.tar.gz.
File metadata
- Download URL: chiefpay-1.2.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9bf71afc224f379cbba52c52e9618f0faa3efb8d4d0584d4fe3dc5f23dd58d0
|
|
| MD5 |
26fcddfbe6b50ea4d38fff49d56ceb92
|
|
| BLAKE2b-256 |
844f1764b9d5683e7c610910d19385b24e285a235b7f90f5e50dc1fec191d2ac
|
File details
Details for the file chiefpay-1.2.0-py3-none-any.whl.
File metadata
- Download URL: chiefpay-1.2.0-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2177e289f10b9d1c5a5b86c2f7dbeceaea175245c53d9a839e9bfc6672aeeee
|
|
| MD5 |
d831d22e13b754bb4f0cfb0326dab6af
|
|
| BLAKE2b-256 |
e6eff635773cd76b541691bd5a69d8f446dbdf3c80aff7bcc3996a42f83eb773
|