Metadata-Version: 2.4
Name: trigguard
Version: 0.1.0
Summary: TrigGuard Gateway Client
Home-page: https://github.com/TrigGuard-AI/TrigGuard
Author: TrigGuard AI
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-python
Dynamic: summary

# trigguard (PyPI)

Official **Python 3.9+** client for the TrigGuard **execution gateway** — `POST /execute` using only the **standard library** (`urllib`).

## Install (from PyPI)

```bash
pip install trigguard
```

## Editable (monorepo)

```bash
cd sdk/python && pip install -e .
```

## Usage

```python
import os
from trigguard import Client

client = Client(
    api_key=os.environ["TG_API_KEY"],
    base_url="http://127.0.0.1:8080",
)
r = client.execute(
    surface="spendCommit",
    signals={"riskScore": 0.9},
    context={"amount": 1000},
)
print(r["decision"], r.get("execution_id"))
```

- **Auth:** `Authorization: Bearer <api_key>`
- **Errors:** `TrigGuardError` on non-2xx

## Build & publish (maintainers)

Run from the **repository root** (not from `sdk/node` — `scripts/` is at the root).

```bash
cd /path/to/TrigGuard
python3 -m pip install build twine
bash scripts/publish-pypi.sh
```

On macOS, if `pip` is not found, use **`python3 -m pip`** as above. Configure **twine** (`~/.pypirc` or env) before upload.

## See also

- [SDK quickstart (repo)](../../docs/SDK_QUICKSTART.md)
- [LangChain integration](../../docs/integrations/LANGCHAIN.md)
