Metadata-Version: 2.4
Name: ara-protocol
Version: 0.1.0
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Summary: Python binding for ara-protocol — typed primitive kernel for governed acts on any compute surface.
Keywords: protocol,governance,ed25519,arqera,pyo3
Author-email: ARQERA Ltd <dev@arqera.io>
License: BUSL-1.1
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/Arqera-IO/ara-protocol
Project-URL: Repository, https://github.com/Arqera-IO/ara-protocol

# ara-protocol-py

Python binding for [ara-protocol](https://github.com/Arqera-IO/ara-protocol) —
the typed primitive kernel for governed acts on any compute surface.

Built with [PyO3](https://pyo3.rs/) + [maturin](https://www.maturin.rs/).
Single `abi3-py39` wheel covers CPython 3.9+.

## Status

Movement 2 adoption layer. First primitive bound: `ProtocolAddress`.
Remaining primitives (anchor, envelope, manifest, signing_authority,
peer_identity, …) land behind the same `import ara_protocol` surface
on the same release cadence.

## Why this exists

ARQERA backend services (Python) had been parallel-implementing
kernel concepts in `app/services/substrate_client.py` instead of
consuming the Rust kernel directly. That violated USCP-v1 (Universal
Substrate Citizenship Principle): every layer must consume substrate
truth, not re-derive it.

This binding closes the gap. Backend Python imports the kernel
crate's exact types, parses + emits the canonical wire form, and
inherits the kernel's invariants for free.

## Build

```bash
cd bindings/python/ara-protocol-py
pip install maturin
maturin develop                  # builds + installs into the active venv
python -c "import ara_protocol; print(ara_protocol.__version__)"
```

Release wheel:

```bash
maturin build --release          # produces target/wheels/ara_protocol-*.whl
```

## Use

```python
from ara_protocol import ProtocolAddress

addr = ProtocolAddress("act", "probe", "cloudflare-1776233934")
assert addr.to_uri() == "arq://act/probe/cloudflare-1776233934"

parsed = ProtocolAddress.parse(addr.to_uri())
assert parsed == addr
assert parsed.address_class == "act"
assert parsed.type == "probe"
assert parsed.ref == "cloudflare-1776233934"
```

## Layout

- `Cargo.toml` — cdylib crate, pyo3 + path-dep on `ara-protocol-primitives`
- `pyproject.toml` — maturin backend, abi3-py39 wheel
- `src/lib.rs` — `#[pymodule]` exposing kernel types
- `tests/` — pytest suite that mirrors the Rust unit tests

## License

BUSL-1.1. Same as the rest of ara-protocol.

