inamprotocol (Python SDK)
Reference Python client for the INAM Protocol — parity with the TypeScript InamClient in ../src/sdk/client.ts. See ../SPEC.md for the full protocol specification.
Install (development)
python -m venv .venv
./.venv/Scripts/python.exe -m pip install -e . pytest # Windows
# ./.venv/bin/python -m pip install -e . pytest # macOS/Linux
Test
./.venv/Scripts/python.exe -m pytest -v
tests/test_interop.py is the important one: it checks this SDK's did:key encoding, canonical JSON, and Ed25519 signing against fixed values generated once by the TypeScript reference implementation (../scripts/interop-vectors.ts). If a change here ever breaks that test, a receipt signed by this SDK would stop verifying against a registry or another SDK written in a different language — that's the whole point of the test.
Usage
from inamprotocol import InamClient, generate_keypair
keypair = generate_keypair()
client = InamClient("http://localhost:4021", keypair)
profile = client.register_agent(["document-extraction"], {"name": "My Agent"})
print(profile["id"]) # did:key:z...
reputation = client.get_reputation(profile["id"])
See examples/interop_worker.py for a full worker-side flow (register, link an external identity, submit signed Execution Receipt drafts), and ../scripts/run-interop-demo.sh for the end-to-end cross-language demo (a TypeScript requester and this Python worker doing real business through the same live registry).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file inamprotocol-0.2.0.tar.gz.
File metadata
- Download URL: inamprotocol-0.2.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6699115555479accadf8fd15b00dc97dabd55af33809af0d9a2b15bdd511233
|
|
| MD5 |
e23627f3ba8401cb87ec643f11e4a7ca
|
|
| BLAKE2b-256 |
3eaa0486ee789e73b3a2c067878fa2e62fcd344ac3630e17ccdc3800a71ee3a5
|
File details
Details for the file inamprotocol-0.2.0-py3-none-any.whl.
File metadata
- Download URL: inamprotocol-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db790c723a88d0076384969cf1eb790fed677fdefe7e21ad6994fab96dacca15
|
|
| MD5 |
cb5bbf40a7d9202badd04508d2374f2b
|
|
| BLAKE2b-256 |
fe9dbea5d0d59759ed6659a7db61ef41c423211f2c3ecc2205ccc4cec59e9482
|