Metadata-Version: 2.4
Name: ihela-sdk
Version: 0.1.0
Summary: Python SDK for the iHela financial services API
Project-URL: Homepage, https://github.com/UbuhingaVizion/ihela-sdk
Project-URL: Repository, https://github.com/UbuhingaVizion/ihela-sdk
Project-URL: Documentation, https://UbuhingaVizion.github.io/ihela-sdk/
Project-URL: Issue Tracker, https://github.com/UbuhingaVizion/ihela-sdk/issues
Project-URL: Changelog, https://github.com/UbuhingaVizion/ihela-sdk/releases
Author-email: UbuViz <info@ubuviz.com>
License: MIT License
License-File: LICENSE
Keywords: api-client,banking,burundi,financial-services,ihela,mobile-money,oauth2,payments
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Requires-Python: >=3.10
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: requests>=2.22.0
Provides-Extra: django
Requires-Dist: django-allauth>=0.60.0; extra == 'django'
Requires-Dist: django>=5.2; extra == 'django'
Provides-Extra: docs
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
Requires-Dist: mkdocs>=1.5.0; extra == 'docs'
Description-Content-Type: text/markdown

# iHela SDK

[![PyPI version](https://img.shields.io/pypi/v/ihela-sdk)](https://pypi.org/project/ihela-sdk/)
[![Python versions](https://img.shields.io/pypi/pyversions/ihela-sdk)](https://pypi.org/project/ihela-sdk/)
[![License](https://img.shields.io/pypi/l/ihela-sdk)](https://github.com/UbuhingaVizion/ihela-sdk/blob/develop/LICENSE)
[![Docs](https://img.shields.io/badge/docs-mkdocs-blue)](https://UbuhingaVizion.github.io/ihela-sdk/)

Python SDK for the iHela Credit Union API for financial services in Burundi.

## Installation

```bash
pip install ihela-sdk
```

With Django integration:

```bash
pip install "ihela-sdk[django]"
```

Or with `uv`:

```bash
uv add ihela-sdk
# with django extra
uv add "ihela-sdk[django]"
```

## Quick Start

```python
from ihela_sdk import MerchantClient

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

For async applications (FastAPI, async Django):

```python
from ihela_sdk import AsyncMerchantClient

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

## Exception Handling

```python
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
- **Django Integration**: Pre-built views for django-allauth
- **Async Support**: Full async client variants using httpx

## Documentation

Full documentation at [UbuhingaVizion.github.io/ihela-sdk](https://UbuhingaVizion.github.io/ihela-sdk/).

## License

MIT — see [LICENSE](LICENSE).
