Metadata-Version: 2.4
Name: lenco-python
Version: 2.0.0
Summary: Python SDK for Lenco API - Payments, Transfers, Collections
Project-URL: Documentation, https://docs.lenco.co
Project-URL: Repository, https://github.com/alexasomba/lenco-python
Project-URL: Issues, https://github.com/alexasomba/lenco-python/issues
Author-email: Alexander Asomba <alex@asomba.com>
License-Expression: MIT
License-File: LICENSE
Keywords: africa,api,fintech,lenco,mobile-money,payments,sdk
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx>=0.25.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# lenco-python

Python SDK for Lenco API - Payments, Transfers, Collections

## Installation

```bash
pip install lenco-python
# or
poetry add lenco-python
```

## Quick Start

```python
from lenco import Lenco

client = Lenco(
    api_key="your-api-key",
    environment="production"  # or "sandbox"
)

# Get accounts
accounts = client.accounts.list()

# Transfer to bank account
transfer = client.transfers.to_bank_account(
    account_id="your-account-uuid",
    account_number="0123456789",
    bank_id="bank-uuid",
    amount=10000,
    reference="payment-001",
    narration="Payment for services"
)

# Collect via mobile money
collection = client.collections.from_mobile_money(
    amount=5000,
    reference="order-123",
    phone="0971234567",
    operator="airtel",
    country="zm"
)
```

## Async Support

```python
import asyncio
from lenco import AsyncLenco

async def main():
    client = AsyncLenco(api_key="your-api-key")
    
    # Concurrent requests
    accounts, banks = await asyncio.gather(
        client.accounts.list(),
        client.banks.list(country="ng")
    )
    
    print(f"Found {len(accounts)} accounts")
    print(f"Found {len(banks)} banks")

asyncio.run(main())
```

## Features

- [x] Full type hints support
- [x] Sync and async clients
- [x] Accounts, Banks, Transfers, Collections, Settlements, Transactions APIs
- [x] Webhook signature verification
- [x] Automatic retries with exponential backoff
- [x] Pydantic models for request/response validation

## Documentation

Full API documentation available at [docs.lenco.co](https://docs.lenco.co)

## Author

Alexander Asomba ([@alexasomba](https://github.com/alexasomba)) · [𝕏 @alexasomba](https://x.com/alexasomba)

## License

MIT
