Metadata-Version: 2.4
Name: a2ea-py
Version: 0.1.0
Summary: Official Python client for the A2EA telemetry and attribution platform.
Author: AI Blockchain Ventures
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.31.0

# a2ea-py

Official Python SDK for sending A2EA telemetry to the backend.

## Install

```bash
pip install a2ea-py
```

## Quickstart

```python
from a2ea import A2EAClient

client = A2EAClient(
    api_key="your X-A2EA-API-Key"
)


@client.track_agent(task_type="data_processing")
def run_agent(payload):
    return process(payload)
```

### Optional configuration

- `base_url`
  - Defaults to `https://aimodularity.com`
  - Set this when testing locally against `http://127.0.0.1:4080`
- `agent_id`
  - Optional override if you want to assign a fixed agent identifier instead of the default host/process-based value

Example for local development:

```python
from a2ea import A2EAClient

client = A2EAClient(
    api_key="your X-A2EA-API-Key",
    base_url="http://127.0.0.1:4080",
    agent_id="agent_pipeline_014",
)
```

## What the client sends

Each tracked function call produces:

- `eventId`
- `agentId`
- `timestamp`
- `durationMs`
- `taskType`
- `outcome`
- `verification`

The verification payload is signed locally with HMAC-SHA256 using the workspace API key so the backend can verify the telemetry envelope.

## Reliability behavior

- submission runs in a background thread
- transient failures are retried with backoff
- exhausted events are retained in a local fallback buffer

## Local package test commands

```bash
python -m unittest discover tests
python -m build
pip install dist/a2ea_py-0.1.0-py3-none-any.whl
```
