Metadata-Version: 2.4
Name: unitly
Version: 0.1.0
Summary: Python SDK for Unitly — searchable operational history for serialised hardware units
Project-URL: Homepage, https://unitly.polsia.app
Project-URL: Documentation, https://unitly.polsia.app/docs
Project-URL: Repository, https://github.com/manjchana/unitly
Author-email: Manjot Chana <manjot.chana93@gmail.com>
License: MIT
Requires-Python: >=3.8
Requires-Dist: requests>=2.28
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: responses; extra == 'dev'
Description-Content-Type: text/markdown

# Unitly Python SDK

Track hardware units through manufacturing with a searchable event timeline.

## Install

```bash
pip install unitly
```

That's it — no extra index URLs needed.

## Quick start

```python
from unitly import Unitly

client = Unitly()   # reads UNITLY_API_KEY from env

# Register a unit
client.units.create(
    "SN-001",
    name="Proto board v2",
    hardware_revision="rev-c",
    firmware_version="1.2.3",
)

# Push a test event
client.events.create(
    "SN-001",
    event_type="test_pass",
    description="ATE pass — all DUTs green",
    metadata={"station": "ATE-01", "temp_c": 25},
)

# Get the full timeline
timeline = client.events.list(serial_number="SN-001")
for e in timeline["events"]:
    print(e["event_type"], e["created_at"])
```

## CLI

`pip install unitly` also installs the `unitly` command:

```bash
export UNITLY_API_KEY=your-key-here

unitly register SN-001 --hw rev-c --fw 1.2.3 --name "Proto board v2"
unitly push SN-001 test_pass --desc "ATE pass" --data '{"station":"ATE-01"}'
unitly timeline SN-001
unitly units
unitly keys list
```

## Environment variables

| Variable | Default | Description |
|---|---|---|
| `UNITLY_API_KEY` | *(required)* | Your API key |
| `UNITLY_API_URL` | `https://unitly.polsia.app/api` | API base URL |

## Docs

Full API docs: [https://unitly.polsia.app/docs](https://unitly.polsia.app/docs)