Skip to main content

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

inamprotocol-0.4.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inamprotocol-0.4.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file inamprotocol-0.4.0.tar.gz.

File metadata

  • Download URL: inamprotocol-0.4.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.0

File hashes

Hashes for inamprotocol-0.4.0.tar.gz
Algorithm Hash digest
SHA256 31407135f7497ddbfc4d63cf1b7827c67ff85191e5e767dd590312e2da9532d0
MD5 f06426efbb0b8af0793e2b09cae73332
BLAKE2b-256 faa323e34b7139bcbffed10f8689695e09fa11869e02a937e4b987b4ca7d76ac

See more details on using hashes here.

File details

Details for the file inamprotocol-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: inamprotocol-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.0

File hashes

Hashes for inamprotocol-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d46638854677a213852bfcaf3da67b7c8cba71f66161d915a4dece5e703eae5
MD5 c9fc9abd61107ac82020e5215d03ab17
BLAKE2b-256 940dff5cda652b88e941f27b30dd0d45596cd779fa6f498896af7b47959475c5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.1

2 files

This release

0.4.0 This release

2 files

0.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page