Skip to Content
ClientsPython

Python client

Request signing, checkout, payouts and webhooks for Python 3.10 or later. A synchronous Client and an asynchronous AsyncClient share the same operations, built on httpx , the only runtime dependency.

Repository: selcom-developers/selcompy 

Install

pip install selcompy

Quickstart

Pay a utility bill from your float account and act on the typed status.

from selcompy import ( Client, Config, Credentials, Environment, Status, UtilityPaymentRequest, ) config = Config( environment=Environment.SANDBOX, # no default: you always choose credentials=Credentials( api_key="...", api_secret="...", vendor="TILL123", pin="...", ), ) with Client(config) as client: result = client.utility_payment( UtilityPaymentRequest( transid="PAYOUT-1001", # your own deterministic ID utilitycode="LUKU", utilityref="54100000001", amount=5000, # whole TZS ) ) if result.status is Status.SUCCESS: print(result.value.receipt)

The asynchronous client has the same operations, and every method is a coroutine:

from selcompy import AsyncClient async with AsyncClient(config) as client: result = await client.order_status("ORD-1001")

The environment is required and has no default. Every operation returns a Result with one of the typed statuses: SUCCESS, PENDING, AMBIGUOUS, FAILED or NOT_FOUND.

The README  covers configuration, every operation, results and errors, idempotency, replacing the transport, webhooks and security.

How it behaves

The client follows the shared spec. These pages explain what it does:

Help and issues

Found a problem, or want to help? Open an issue in the repository , or read Contributing. For security problems, see Security reporting.

Last updated on