Python Library for Receipt Verification
Free Python library for verifying Ethiopian bank receipts.
View library on GitHubPython library overview
The cheki Python library is a client for the cheki REST API. ChekiClient has verify, verify_batch (up to 20 receipts), get_banks, get_health and get_receipt_url. Each attempt waits up to 65 seconds, and a network error, 5xx or 429 is retried at most once, after Retry-After when the server sends one.
Quick start
pip install cheki, then use ChekiClient as a context manager and call verify with the bank id, the reference and, for CBE or BOA, account_number. verify returns a result for API errors too instead of raising, so check result.is_verified: it is the only success signal. A BOA QR code the bank could not confirm comes back with decoded_only set and is not verified.
API client first
Since the API hardening, the library is an API client first:
- ChekiClient: calls cheki.et or your self-hosted server; verification and the fail-closed gate run on the server
- Errors: result.http_status, result.error, result.is_rate_limited and result.retry_after; result.fallback_url for geo-blocked banks
- CLI: cheki-verify cbe https://mbreciept.cbe.com.et/fHCxExampleRcpt01 calls the API and exits 0 only when the receipt is verified
- Direct mode (from cheki import verify) is deprecated and will be removed in the next major version
Frequently asked questions
How do I install the cheki Python library?
Install it with pip install cheki (Python 3.10+). It uses the requests library for HTTP calls and also installs the cheki-verify command-line tool.
Does the Python library parse receipts itself?
No. ChekiClient calls the cheki API, which fetches the receipt from the bank, parses it and applies the verification gate on the server. You get structured fields back (amount, sender, receiver, date) without parsing anything locally.
Can I use the Python library without the API?
The old direct mode, which fetched banks from your own machine, is deprecated: its parsers lack the server's verification gate and hardening, and it will be removed in the next major version. If you cannot use the hosted API, self-host the cheki server (on an Ethiopian IP if you need the geo-blocked banks) and point ChekiClient at it.
View library on GitHub
Open cheki