Skip to main content

ProofTask SDK for Python

Status: not yet published. The project name prooftask is reserved for when the owner creates the PyPI project.

A client for the Agent API, generated from its OpenAPI contract, plus webhook signature verification, idempotent request IDs, pagination and typed errors. Standard library only, Python 3.9 or later.

Offline record verification: prooftask.conformity. An independent verifier for Conformity 1.0/1.1 records, written from the published specification (standards/ and the implementer's guide), not ported from the JavaScript verifier. It passes the whole conformance suite in conformance/conformity-1. Ed25519 verification is a pure-Python RFC 8032 implementation tested against the RFC vectors, so the package stays dependency-free.

from prooftask.conformity import verify_record
report = verify_record(open("record.json", "rb").read(), {"issuers": {"https://issuer.example": [
    {"id": "key-1", "publicKeyPem": PEM, "status": "ACTIVE"}]}})
print(report["status"], report["reasons"])   # INVALID, INDETERMINATE, PARTIAL_DISCLOSURE or VERIFIED_WITH_LIMITATIONS

or python -m prooftask.conformity ARTIFACT TRUST [OPTIONS.json] (exit 0 verified, 1 INVALID, 3 INDETERMINATE, 2 usage). You supply the trusted issuer keys; the verifier never fetches them. Not implemented: anchoring evidence (evidence/, trusted timestamps and Bitcoin proofs, package standard 1.2). A 1.1 package that carries it raises UnsupportedEvidence (CLI exit 2) instead of being reported without it; use the Node.js verifier (node verify-conformity.mjs RECORD [TRUST]) for those. The ProofTask product record wrapper (prooftask-result-record-*.json, with the product trust bundle) is also Node.js only.

Quickstart

from prooftask import ProofTaskClient, new_request_id, construct_webhook_event

client = ProofTaskClient(token=os.environ["PROOFTASK_AGENT_TOKEN"])
me = client.get_agent()
project = client.get_project(id="delivery_...")["project"]

# Save the whole body (with its request ID) before sending. After an uncertain result, resend it unchanged.
body = {"requestId": new_request_id(), "target": "https://example.com/hooks/prooftask", "projectIds": [project["taskId"]],
        "eventTypes": ["acceptance.decided"], "expiresAt": "2026-12-20T00:00:00.000Z", "confirmed": True}
created = client.create_project_webhook(body=body)

examples/quickstart.py also runs a receiver and verifies a signed test request. The repository's test suite runs it against a local ProofTask server.

Methods

Every operation is a method named after its operationId in snake_case, with keyword arguments: path and query parameters in snake_case (subscription_id, project_id) and the JSON request body. Request and response shapes are TypedDicts in prooftask.types.

Retries, pagination, errors

  • Network failures, timeouts, 429 and 503 are retried (two retries by default). A write is retried only when its body carries a requestId, with the exact same bytes. ProofTaskTransportError.outcome_unknown means: resend the saved body.
  • client.iterate_webhook_deliveries(subscription_id=...) yields every page and follows next; paginate() is generic.
  • Non-success answers raise BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, RateLimitError or ServiceUnavailableError, all ProofTaskApiError with status, code, next_action, field, detail, reason and human_url.

Webhooks

hook = construct_webhook_event(secret, raw_body, request_headers)  # raises WebhookVerificationError
if hook.is_test:
    return  # acknowledge test requests, do not act on them

Pass the exact raw body bytes. The signature is v1= + hex HMAC-SHA256 of timestamp + "." + raw body, compared with hmac.compare_digest; the timestamp must be within five minutes.

Development

src/prooftask/_generated_*.py come from node scripts/generate-sdks.mjs at the repository root; never edit them. python3 -I tests/test_sdk.py runs the unit tests.

License

Apache License, Version 2.0. See LICENSE. Only the SDKs and the offline verifier are open source; the ProofTask service is proprietary.

Metadata

Release files for prooftask 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 prooftask 0.1.0
File Size Uploaded Provenance Actions
prooftask-0.1.0.tar.gz 67.1 kB Without provenance Details for prooftask-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 147.6 kB

Release files / prooftask-0.1.0.tar.gz

Download URL prooftask-0.1.0.tar.gz
Size 67.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9e9ad04caddd52c06816a887a576bd342e0d2f4d1cc7735aea369b26624ddb97
BLAKE2b-256 checksum
How to use checksums
6b5c99fb5091446ac14e1925f0f0d125c4f94c392014425ef8452c4a0ccc8a8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

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

Download URL prooftask-0.1.0-py3-none-any.whl
Size 80.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffa5c653d48ff9389ccd51b9e839b6b98a75a8b9d68de0017d7612d46b8586aa
BLAKE2b-256 checksum
How to use checksums
18f56e49c5de4b323693bd3382bdf1e070ba2d0abc17d95539b608c4eba7bd83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for prooftask 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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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