Metadata-Version: 2.4
Name: decision-trace
Version: 0.1.1
Summary: Decision Trace v1 SDK
Author: Decision Trace contributors
Maintainer: Shobha Sethuraman
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/logicoflife/decision-trace
Project-URL: Repository, https://github.com/logicoflife/decision-trace
Project-URL: Issues, https://github.com/logicoflife/decision-trace/issues
Project-URL: Documentation, https://github.com/logicoflife/decision-trace/tree/main/sdk/python
Keywords: decision-trace,telemetry,audit,observability,governance
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
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.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: pydantic>=2.0
Requires-Dist: jsonschema>=4.0
Requires-Dist: PyYAML>=6.0
Requires-Dist: opentelemetry-api>=1.20
Requires-Dist: opentelemetry-sdk>=1.20
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: fastapi>=0.110; extra == "test"
Requires-Dist: httpx>=0.24; extra == "test"
Provides-Extra: collector
Requires-Dist: fastapi>=0.110; extra == "collector"
Requires-Dist: uvicorn>=0.23; extra == "collector"
Dynamic: license-file

# Decision Trace Python SDK

The Python SDK provides the core tracing API, CLI, examples, and local collector workflow for Decision Trace.

## Install

```bash
pip install decision-trace
```

Install the optional local collector dependencies if you want the bundled FastAPI collector and `decision-trace dev` workflow:

```bash
pip install "decision-trace[collector]"
```

## Quickstart

```python
from decision_trace import decision

with decision("loan.approval", actor={"type": "system", "id": "risk_engine"}) as d:
    d.evidence("credit_score", 720)
    d.policy_check("min_score_700", "pass")
    d.outcome("approved")
```

## Local Collector

Start the local collector:

```bash
decision-trace dev
```

This binds a local-only example collector on `127.0.0.1:8711` and writes events to `./data/events.jsonl`.

## Development

```bash
pip install -e ".[collector,test]"
pytest
```

## Docs And Examples

- Examples: https://github.com/logicoflife/decision-trace/tree/main/sdk/python/examples
- Repository: https://github.com/logicoflife/decision-trace
- Issues: https://github.com/logicoflife/decision-trace/issues
