Skip to main content

Official Python SDK for ChamaPay API — Financial Infrastructure for African Savings Groups

Project description

ChamaPay Python SDK

Official Python SDK for the ChamaPay API.

Installation

pip install chamapay

Usage

from chamapay import ChamaPay

api = ChamaPay('cpk_live_your_api_key', 'your_api_secret')

# List members
members = api.members.list(status='Active', page=1, limit=20)

# Create a contribution (idempotent)
contribution = api.contributions.create(
    {'member_id': 'MFT001', 'amount': 5000},
    idempotency_key='550e8400-e29b-41d4-a716-446655440000'
)

# Get loan details
loan = api.loans.get('LN001')

API Reference

Resource Methods
members list, get, create, update, delete
contributions list, get, create (with idempotency key)
loans list, get, create
fines list, create
meetings list, create
projects list, create
accounts list, get
welfare list
dividends list
documents list
election_notices list
document_reminders list
audit list
liabilities list, create
reports get

Error Handling

from chamapay import ChamaPayError, ValidationError, RateLimitError

try:
    api.members.create({...})
except ValidationError as e:
    print(f"Validation failed: {e.details}")
except RateLimitError as e:
    print(f"Rate limited. Retry after {e.retry_after}s")
except ChamaPayError as e:
    print(f"API Error [{e.code}]: {e.message}")

Publishing

pip install build twine
python -m build
twine upload dist/*

Requires a PyPI account with access to the chamapay package.

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

chamapay-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

chamapay-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file chamapay-1.0.0.tar.gz.

File metadata

  • Download URL: chamapay-1.0.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for chamapay-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9f1dbef81e7b053eb8dae61c9fbe8368a0d55600f6b171231c597583afd589d3
MD5 20f6b32f08f909d2c2f06cc6a1c67619
BLAKE2b-256 23dc8d866957679eb49ee7737f50f59e40201ee3494d2fc875271fcc56ecd3af

See more details on using hashes here.

File details

Details for the file chamapay-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: chamapay-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for chamapay-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 635c99e894203726018fec3337e9b0bb92742391298f945a517204f0b1a3272a
MD5 7b35c005c9592ec6eb6ed152d95ba574
BLAKE2b-256 e81515cfc4bc78fae481193ac48009df3a9e993af001e46a24f372fe55552d87

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