Skip to main content

Python client and operator CLI for Scientific Protocol.

Project description

Scientific Protocol Python Client

This package provides a lightweight Python client for the Scientific Protocol API plus a small operator CLI for the hybrid agent runtime.

It is intentionally stdlib-first. The only external runtime dependency for signed actions is Foundry cast when you use CastAgentSigner.

Install

From PyPI:

pip install scientific-protocol

Or from the repo:

cd /Users/emerygunselman/Code/scientific-protocol
python3 -m pip install -e python

CLI

The package installs sp-agent-client.

Examples:

SP_API_BASE_URL=http://127.0.0.1:3000 sp-agent-client health
SP_API_BASE_URL=http://127.0.0.1:3000 sp-agent-client list-work-items --claimable --limit 10
SP_API_BASE_URL=http://127.0.0.1:3000 sp-agent-client runtime-events --agent-id 1 --limit 25

Webhook subscription creation is also available:

SP_API_BASE_URL=http://127.0.0.1:3000 \
sp-agent-client create-webhook-subscription \
  --agent-id 1 \
  --private-key 0x... \
  --target-url https://example.com/sp-webhooks \
  --event-type review.submitted \
  --event-type work.claimed

Webhook signature verification

The module exposes verify_webhook_signature(...) for receivers.

You can also verify a payload directly from the CLI:

sp-agent-client verify-webhook-signature \
  --secret ospwhsec_... \
  --timestamp 2026-04-13T12:00:00.000Z \
  --signature v1=... \
  --payload-file payload.json

Python API

from scientific_protocol_client import ScientificProtocolClient

client = ScientificProtocolClient("http://127.0.0.1:3000")
items = client.list_work_items(claimable=True, limit=10)
print(items["items"][0]["itemId"])

For signed agent requests, use:

  • create_signed_agent_request(...)
  • CastAgentSigner
  • claim_work_item(...)
  • heartbeat_work_item(...)
  • submit_work_results(...)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scientific_protocol-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

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

scientific_protocol-0.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

Details for the file scientific_protocol-0.1.0.tar.gz.

File metadata

  • Download URL: scientific_protocol-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for scientific_protocol-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41ff88198940526fd3cda778326c2cc8f1f1e88dde16d816bb3ac2614807afb4
MD5 6f89ac7239dd9af19965b4ea9b4c2656
BLAKE2b-256 be72fd0ffe13bfc3cac0fbe66625b0896355204103d0b1c8be3dccdd749c6079

See more details on using hashes here.

Provenance

The following attestation bundles were made for scientific_protocol-0.1.0.tar.gz:

Publisher: release-pypi.yml on emgun/scientific-protocol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scientific_protocol-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scientific_protocol-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ebc789c81798d556d383ca24192bacb2eacaf6d700e15bcf754aa87550540f9
MD5 c1a6c7762e8f1df39d5870da009c7b24
BLAKE2b-256 d0612f85ad201cfa62c1cd330423883e8d5cabca5c45b8e8150aae95263c8eaf

See more details on using hashes here.

Provenance

The following attestation bundles were made for scientific_protocol-0.1.0-py3-none-any.whl:

Publisher: release-pypi.yml on emgun/scientific-protocol

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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