Metadata-Version: 2.4
Name: kohi-python
Version: 0.1.4
Summary: Kohi API monitoring SDK for Python
License-Expression: MIT
Project-URL: Homepage, https://kohicorp.com
Keywords: api,monitoring,observability,kohi
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
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: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx<1.0,>=0.27.0
Requires-Dist: pydantic<3.0,>=2.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Dynamic: license-file

# kohi-python

Python SDK for Kohi.

## Install

```bash
pip install kohi-python
```

## Quick Start

```python
from fastapi import FastAPI
from kohi import Monitor

app = FastAPI()
monitor = Monitor(
    app=app,
    project_key="pk_...",
    secret_key="...",
)
```

`Monitor(app=...)` auto-instruments supported `FastAPI` and `Flask` apps. You can also create a monitor without `app=` and submit events manually.

## Behavior

- Validates `project_key` / `secret_key` on startup
- Batches events, gzips payloads, and signs them with HMAC-SHA256
- Retries retryable network and HTTP failures before dropping a batch
- Redacts common secret fields and masks emails before send
- Preserves client IP extraction priority across `cf-connecting-ip`, `x-forwarded-for`, and related proxy headers
