Skip to main content

Python SDK for the iHela financial services API

Project description

iHela SDK

PyPI version Python versions License Docs

Python SDK for the iHela Credit Union API for financial services in Burundi. Framework-agnostic — works with Django, Flask, FastAPI, or any Python application.

Installation

pip install ihela-sdk

Or with uv:

uv add ihela-sdk

Quick Start

from ihela_sdk import MerchantClient

client = MerchantClient("your_client_id", "your_client_secret", prod=False)

For async applications (FastAPI, asyncio):

from ihela_sdk import AsyncMerchantClient

client = AsyncMerchantClient("your_client_id", "your_client_secret", prod=False)

OAuth2 SSO

from ihela_sdk import MerchantAuthorizationClient

auth = MerchantAuthorizationClient("client_id", "client_secret", prod=False)
login_url = auth.get_authorization_url(redirect_uri="https://app.com/callback/")
# Redirect user to login_url, handle callback with auth.authenticate(code, redirect_uri)

See the Authentication guide for Django, Flask, and FastAPI examples.

Exception Handling

from ihela_sdk import iHelaError, iHelaAPIError, iHelaAuthenticationError

try:
    bill = client.init_bill(2000, "client@example.com", "Payment", "ref-001")
except iHelaAuthenticationError:
    print("Authentication failed. Check your credentials.")
except iHelaAPIError as e:
    print(f"API error (HTTP {e.status_code})")
except iHelaError:
    print("A client error occurred.")

Features

  • Merchant Services: Bill init/verify, cash-in, bank lists, customer lookup
  • Banking Services: Deposits, withdrawals, account lookup/balance, statements, transaction fees
  • Agent Services: Operations, withdrawal validation
  • OAuth2: Client credentials and authorization code flows
  • Framework-Agnostic: No web framework dependency — OAuth2 primitives work everywhere
  • Async Support: Full async client variants using httpx

Documentation

Full documentation at UbuhingaVizion.github.io/ihela-sdk.

License

MIT — see LICENSE.

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

ihela_sdk-0.3.0.tar.gz (124.8 kB view details)

Uploaded Source

Built Distribution

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

ihela_sdk-0.3.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file ihela_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: ihela_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 124.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ihela_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 37322c3a63d20fb62d7e3809347888726b6175fae802e677a388a1e6e37c2415
MD5 2db410279259397fbbbdfdbc2cdfca76
BLAKE2b-256 5cf9746f206889f972916d8dc739bbf6da30ee729ff9e1c8ca25e4a3af2590d1

See more details on using hashes here.

File details

Details for the file ihela_sdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ihela_sdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ihela_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 736e486ba43ef4113f50072c36fababbf34a759a9c64e715a29dc2329d62abed
MD5 edf2cebce4b13a5facf16624c8ff9976
BLAKE2b-256 262dc691dd907d44ef179eb8711455e0daf88848779f3e393e51f2dfb7e4d1d5

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