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.2.0.tar.gz (8.7 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.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

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

Hashes for inamprotocol-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a6699115555479accadf8fd15b00dc97dabd55af33809af0d9a2b15bdd511233
MD5 e23627f3ba8401cb87ec643f11e4a7ca
BLAKE2b-256 3eaa0486ee789e73b3a2c067878fa2e62fcd344ac3630e17ccdc3800a71ee3a5

See more details on using hashes here.

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

Hashes for inamprotocol-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db790c723a88d0076384969cf1eb790fed677fdefe7e21ad6994fab96dacca15
MD5 cb5bbf40a7d9202badd04508d2374f2b
BLAKE2b-256 fe9dbea5d0d59759ed6659a7db61ef41c423211f2c3ecc2205ccc4cec59e9482

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.1

2 files

0.4.0

2 files

This release

0.2.0 This release

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