Metadata-Version: 2.4
Name: amlexia
Version: 1.0.1
Summary: Official Amlexia Python SDK — monitor APIs, AI providers, payments, and infrastructure with traces, latency, and provider intelligence.
Author-email: Amlexia <support@amlexia.com>
Maintainer-email: Amlexia <support@amlexia.com>
License: Proprietary. See LICENSE file. Not open source.
Project-URL: Homepage, https://amlexia.com
Project-URL: Documentation, https://amlexia.com
Project-URL: Repository, https://github.com/amlexiahq/amlexia
Project-URL: Bug Reports, https://amlexia.com/contact
Project-URL: Terms, https://amlexia.com/terms
Project-URL: Privacy, https://amlexia.com/privacy
Keywords: amlexia,observability,apm,monitoring,tracing,fastapi,flask,django,opentelemetry
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: urllib3>=1.26.0
Provides-Extra: flask
Requires-Dist: flask>=2.0.0; extra == "flask"
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100.0; extra == "fastapi"
Requires-Dist: starlette>=0.27.0; extra == "fastapi"
Dynamic: license-file

# amlexia

Official **Python SDK** for [Amlexia](https://amlexia.com) — operational intelligence for APIs, AI providers, payments, and infrastructure.

Send events and traces from Flask, FastAPI, Django, or your own code to `https://ingest.amlexia.com`.

> **License:** Proprietary — not open source. See [LICENSE](./LICENSE). Use is subject to the [Amlexia Terms of Service](https://amlexia.com/terms).

## Requirements

- Python 3.8+
- An Amlexia account and project SDK key (`am_...`) from [app.amlexia.com](https://app.amlexia.com)

## Install

```bash
pip install amlexia
```

Optional framework extras:

```bash
pip install "amlexia[fastapi]"
pip install "amlexia[flask]"
```

## Quick start

```python
import os
from amlexia import AmlexiaClient

client = AmlexiaClient(
    sdk_key=os.environ["AMLEXIA_SDK_KEY"],
    ingest_url=os.environ.get("AMLEXIA_INGEST_URL", "https://ingest.amlexia.com"),
)

client.track(
    endpoint="GET /users/:id",
    method="GET",
    status_code=200,
    latency_ms=95,
    provider="internal",
)

client.shutdown()
```

## Framework integrations

| Module | Framework |
|--------|-----------|
| `amlexia.fastapi_integration` | FastAPI / Starlette — `AmlexiaMiddleware` |
| `amlexia.flask_integration` | Flask — `amlexia_track(client)` decorator |
| `amlexia.django_integration` | Django — add `AmlexiaMiddleware` to `MIDDLEWARE` |

### FastAPI

```python
from fastapi import FastAPI
from amlexia import AmlexiaClient
from amlexia.fastapi_integration import AmlexiaMiddleware

client = AmlexiaClient(sdk_key="am_...", ingest_url="https://ingest.amlexia.com")
app = FastAPI()
app.add_middleware(AmlexiaMiddleware, client=client)
```

### Django

```python
# settings.py
MIDDLEWARE = [
    # ...
    "amlexia.django_integration.AmlexiaMiddleware",
]
# Set AMLEXIA_SDK_KEY in the environment
```

## Environment variables

| Variable | Description |
|----------|-------------|
| `AMLEXIA_SDK_KEY` | Project SDK key from the dashboard |
| `AMLEXIA_INGEST_URL` | Optional; defaults to `https://ingest.amlexia.com` |

## Links

- Website: https://amlexia.com
- Dashboard: https://app.amlexia.com
- Support: support@amlexia.com
- Terms: https://amlexia.com/terms
- Privacy: https://amlexia.com/privacy
