Metadata-Version: 2.5
Name: kuahr
Version: 0.3.1
Summary: Official Python client for Kua company people, payroll drafts, events and webhooks.
Project-URL: Homepage, https://docs.kuahr.com
Project-URL: Repository, https://github.com/kuahr/kua-sdk/tree/main/python
Author: Kua
License: MIT
License-File: LICENSE
Keywords: africa,api,kua,nigeria,payments,payroll,wallet
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: httpx>=0.24
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == 'dev'
Description-Content-Type: text/markdown

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kuahr/.github/main/profile/dark.svg">
  <img src="https://raw.githubusercontent.com/kuahr/.github/main/profile/light.svg" alt="Kua" width="150">
</picture>

# Kua Python SDK

Official client for Kua company people, payroll drafts, workforce resources,
events and webhooks. [Documentation](https://docs.kuahr.com/sdks/python).

## Install

The distribution is `kuahr`, with `import kua`. The unrelated PyPI package
named `kua` is not this SDK.

```bash
python -m venv .venv
source .venv/bin/activate
python -m pip install kuahr
```

Requires Python 3.9+. On Windows activate `.venv\Scripts\activate` instead.
Store a sandbox-issued Test key with `payroll:read` in `KUA_API_KEY`:

```python
import os
from kua import Kua
with Kua(api_key=os.environ["KUA_API_KEY"], base_url="https://sandbox-api.kuahr.com") as kua:
    print(kua.payroll_runs.list())
```

## Development

```bash
python -m pip install -e ".[dev]"
python -m pytest -q
```

Expected result: an array of this company's Test payroll runs, including `[]`.
Choose the host explicitly: both clients otherwise default to production.

## Supported boundaries

Employee creation and payroll draft/list operations support Test mode. Events,
webhooks and workforce add-ons require a separately authorised Live key with the
matching resource scopes. Draft creation is not approval or payment; salary setup
is outside this public SDK. Registered-client Kola OIDC uses HTTP separately.

The client does not retry automatically. Persist an operation-specific idempotency
key and exact request before writes. Credential rotation changes that namespace;
reconcile uncertain outcomes before retrying under another credential. Webhook
replay uses a separate stable request key/reason. Queued is not delivered.

## Webhooks and production readiness

Use the included raw-body signature helper and timestamp tolerance, then
deduplicate the verified body's event ID. Commit durable acceptance before
acknowledging a delivery. Follow setup, recovery, rotation and go-live guidance at
https://docs.kuahr.com. Never log credentials or signing secrets.

## Licence

MIT. See LICENSE.
