Metadata-Version: 2.4
Name: rpp402
Version: 0.1.0
Summary: RPP402 Python SDK - programmable commerce for autonomous AI agents on Robinhood Chain. Engineered for agentic frameworks.
Project-URL: Homepage, https://rpp402.com
Project-URL: Documentation, https://rpp402.com/docs
Author: RPP402
License-Expression: MIT
Keywords: agents,payments,robinhood-chain,rpp402,x402
Requires-Python: >=3.9
Requires-Dist: jsonschema>=4.20
Description-Content-Type: text/markdown

# RPP402 Python SDK

**Engineered for agentic frameworks.** The programmable commerce protocol for autonomous AI agents on Robinhood Chain, as an idiomatic Python package - one call per primitive, every response validated against the same [`@rpp402/protocol`](../protocol) JSON Schemas the TypeScript and Rust SDKs use.

```bash
pip install rpp402
```

```python
from rpp402 import create_client

client = create_client(agent_wallet="0xabc...", sign_typed_data=my_signer)

service = client.discover("market-data.example")          # RPP402-001
session = client.session.create(service)                  # RPP402-003
session.quote(service, {                                   # RPP402-002
    "capability": "market-data.quote",
    "settlement_asset": usdg,
})
session.intent({"asset": usdg})                            # RPP402-004
session.settle()                                           # RPP402-005
receipt = session.receipt()                                # RPP402-006
```

## Surface

| Function | Primitive |
|---|---|
| `create_client(...)` | entry point |
| `discover(domain_or_url)` | RPP402-001 Discovery |
| `Session.quote(service, params)` | RPP402-002 Quote + attach leg |
| `Session.intent(params)` | RPP402-004 Payment Intent |
| `Session.settle()` | RPP402-005 Settlement (polls to terminal state) |
| `Session.receipt()` | RPP402-006 Receipt |

Errors: `Rpp402Error` (RFC 9457 problem+json) and `Rpp402ValidationError` (wire-format mismatch).

## Cross-runtime determinism

Amounts are exact decimal strings, never floats (`add_decimal_strings`), and every response is validated against the vendored canonical schemas. The Python, TypeScript, and Rust SDKs run the **same** conformance fixtures in [`../conformance`](../conformance), so all three agree on the wire format byte-for-byte.

## Develop

```bash
python -m unittest discover -s tests
```

Zero runtime deps beyond `jsonschema`; HTTP uses the standard library. MIT licensed.
