Metadata-Version: 2.4
Name: revvyn-sdk
Version: 0.3.0
Summary: Python client for the Revvyn Governance API
Author: DRA Consultancy Ltd
License-Expression: MIT
Project-URL: Homepage, https://revvyn.com
Keywords: revvyn,payments,governance,ai,agents,compliance,sanctions
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
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 :: Office/Business :: Financial
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.25.0
Provides-Extra: verify
Requires-Dist: cryptography>=41.0; extra == "verify"
Dynamic: license-file

# Revvyn SDK

Python client for the Revvyn Governance API. Send a payment intent, receive an Ed25519-signed verdict
(ALLOW / BLOCK / ESCALATE), verify it offline, and report the outcome back. Revvyn governs the decision;
you settle on your own rail.

This SDK is licensed under the MIT License. The Revvyn service it connects to is proprietary and is not covered by this licence.

## Install (once published)

```bash
pip install revvyn-sdk
```

Offline verdict verification needs `cryptography`; install it with the extra:

```bash
pip install "revvyn-sdk[verify]"
```

You do not need this package to verify a verdict — two widely used libraries are enough:
`pip install cryptography httpx`. The integration guide shows the few lines of code.

## Quick start

```python
import httpx
from revvyn_sdk import RevvynClient, verify_verdict

client = RevvynClient(api_key="rvn_live_...")

# Governance-only: returns an Ed25519-signed verdict. Revvyn governs; you settle on your own rail.
signed = client.evaluate(amount=4500, currency="USD", agent_id="agt_your_agent")

jwks = httpx.get("https://api.revvyn.com/.well-known/jwks.json").json()
if verify_verdict(signed, jwks) == "ALLOW":
    ...  # execute on your own rail, then report the real outcome with client.observe(...)
```

## What it does

- Typed responses (dataclasses)
- Automatic retry with exponential backoff
- Rate-limit tracking (`client.last_rate_limit`)
- Error hierarchy: `AuthenticationError`, `NotFoundError`, `RateLimitError`, `ValidationError`
- Offline verdict verification (`verify_verdict`) and inbound-webhook HMAC verification (`verify_webhook`)
- Context-manager support (`with RevvynClient(...) as client:`)
