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 scientific-protocol. The older sp-agent-client command remains available.

Examples:

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

Webhook subscription creation is also available:

SP_API_BASE_URL=http://127.0.0.1:3000 \
scientific-protocol 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:

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

Python API

from scientific_protocol 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.1.tar.gz (6.5 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.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: scientific_protocol-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 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.1.tar.gz
Algorithm Hash digest
SHA256 6591a548b20b6553092ec977f08db847ea38a21570a34f3d2f3c2867d08e6d98
MD5 6075ef5b3902f4ee3639ee4f3f9e5f84
BLAKE2b-256 84ac51dd16b7a685b04d722ca302a98b3e8247c125da5ba31e1ce3c2e8528688

See more details on using hashes here.

Provenance

The following attestation bundles were made for scientific_protocol-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for scientific_protocol-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e8e7170ad75577ee8b6ce5f984349c56db6890ec027391cb130b4c31ab5e186
MD5 f21cd4f04eb873824d76a7fe69fea412
BLAKE2b-256 4622e62476b14bf0ff3d758355342728e3bd3379f80ba949f33f8d59c932866f

See more details on using hashes here.

Provenance

The following attestation bundles were made for scientific_protocol-0.1.1-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