Skip to main content

SPR SDK for Python

SPR, the Sealed Payment Record, in Python: seal your AI agents' payments on your own machine with your company's own key, and check any SPR record or package without Luca. Apache-2.0. Needs cryptography.

from spr import SprBook

book = SprBook(dir="books", agent_id="agt_research", entity="Example Co")

# Before paying: declare, and sign the nonce as the payment's nonce where the rail lets you (x402, EIP-3009).
intent = book.declare(purpose="Market data for the pricing model", max_amount_minor=20000, currency="USDC")
nonce = book.nonce_for(intent["intent_id"])
if book.check_payment(10000, "USDC", nonce=nonce)["decision"] != "approve":
    raise SystemExit("declined")

# After paying: seal it.
record = book.seal(rail="x402", source_id=tx_hash, amount_minor=10000, currency="USDC", nonce=nonce)

The folder, files and records are the same as the JavaScript SDK's, so either language opens the other's book.

Check a package, or run the test vectors:

python -m spr <package folder>
python -m spr --vectors ../packages/spr/vectors/vectors.json

Tests: python -m unittest discover -s tests, from this folder.

Metadata

Release files for spr-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spr-sdk 0.1.0
File Size Uploaded Provenance Actions
spr_sdk-0.1.0.tar.gz 20.2 kB With provenance Details for spr_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spr-sdk 0.1.0
File Interpreter ABI Platform Actions
spr_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for spr_sdk-0.1.0-py3-none-any.whl

Total release size: 40.7 kB

Release files / spr_sdk-0.1.0.tar.gz

Download URL spr_sdk-0.1.0.tar.gz
Size 20.2 kB
Tags Source
SHA-256 checksum
How to use checksums
85b66b04b2282fb5ba68a0a93e65883ce54efe40c2c93c384c4a9614f86c88fe
BLAKE2b-256 checksum
How to use checksums
67f9feb1719320e75bf01cf18488722ac1d262cfd4b50f40a7584b48e33a1cd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / spr_sdk-0.1.0-py3-none-any.whl

Download URL spr_sdk-0.1.0-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c934eb735e08d715e758dc016e34c2d8cbbefd1cf37253984212e1889b6e65d
BLAKE2b-256 checksum
How to use checksums
b66fc1120099c0ff4e133959cff87900f41adc5890e2289249d5403e7408d554
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for spr-sdk 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for spr_sdk-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page