Modern, test-driven Python client for the Paystack API — built to save you time integrating into Python projects.
Project description
Paystack API Wrapper
A clean, intuitive, and reliable Python wrapper for the Paystack API.
This library was built to eliminate repetitive boilerplate when integrating Paystack into your Python projects, while emphasizing modern design, robust error handling, and a test-driven foundation. Covers the full API with clean abstractions, so you can focus on building features—not handling payments.
See the Paystack API docs for reference, and explore the Usage Guide for practical examples.
Installation
pip install paystack-api-wrapper
Quick Start
-
Initialize the client with your secret key
(Best practice: store your secret key as an environment variable
PAYSTACK_SECRET_KEY.)import os from paystack import PaystackClient, APIError secret_key = os.getenv("PAYSTACK_SECRET_KEY") client = PaystackClient(secret_key=secret_key)
-
Make an API call (e.g., initialize a transaction):
try: data, meta = client.transactions.initialize( email="customer@example.com", amount=50000, # amount in kobo currency="NGN" ) print("Transaction initialized:", data) # {'authorization_url': '...', 'access_code': '...', 'reference': '...'} except APIError as e: print(f"API error: {e.message}")
See the Full Usage Guide for details on handling responses, pagination, and advanced error management.
Available APIs
The client exposes all major Paystack API resources as properties:
apple_paybulk_chargeschargecustomersdedicated_virtual_accountsdirect_debitdisputesintegrationmiscellaneouspayment_pagespayment_requestsplansproductsrefundssettlementssubaccountssubscriptionsterminaltransactionstransaction_splitstransferstransfers_controltransfer_recipientsverificationvirtual_terminal
Contributing
Contributions are welcome! Check out the contributing guide to get started.
License
MIT © Joseph Ezekiel – see LICENSE for details.
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
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 paystack_api_wrapper-0.1.1.tar.gz.
File metadata
- Download URL: paystack_api_wrapper-0.1.1.tar.gz
- Upload date:
- Size: 117.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5bc1dca0dc0a894101e99e134d1548ead6fc9e64dfe7de16785097aa886ae2f
|
|
| MD5 |
e508ef8f4a4eca4a182cf6e5068f40e9
|
|
| BLAKE2b-256 |
9c39754aff614bbbce90a0730549ccd20a71320027527ff93f287b48b3e4c958
|
File details
Details for the file paystack_api_wrapper-0.1.1-py3-none-any.whl.
File metadata
- Download URL: paystack_api_wrapper-0.1.1-py3-none-any.whl
- Upload date:
- Size: 54.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b6d5112e797cb70e084de612b81334f8c51ceeb9d51da21472b782e4d9eca3f
|
|
| MD5 |
c35e3e372262268ecfe7b12686c81779
|
|
| BLAKE2b-256 |
b5ed21a853d18be7111cbd84a9675e9bff9207c5248bc1451cf56b0ed8662ecb
|