Skip to main content

STDIO Labs

Provenance SDK (Python)

Python SDK for the Provenance platform — queue-based ingestion and full async REST API client.

PyPI version License: MIT Python Version


Installation

pip install provenance-sdk

Quick Start

from provenance_sdk import create
import uuid

provenance = await create(api_key="your-api-key", origin="my-service")

# Queue-based ingestion
await provenance.log(
    resource_type="user",
    resource_id="user-123",
    action="login",
    uow_id=str(uuid.uuid4()),
    interaction={"email": "user@example.com"},
)

# REST API client
api = await provenance.api()
actions = await api.actions.list()
trace = await api.traces.get("user-123")

REST API Client

api = await provenance.api()

# CRUD
action = await api.actions.create({"title": "Deploy", "mnemonic": "DEPLOY"})
await api.actions.update(action["id"], {"title": "Deploy v2"})
await api.actions.delete(action["id"])

# Search & Analytics
results = await api.activity.search({"filters": {"action": "CREATE"}})
data = await api.analytics.query({
    "metrics": ["count"],
    "dimensions": ["action"],
    "timeRange": {"type": "relative", "value": "7d"},
})

# Auto-pagination
async for action in api.actions.list_all():
    print(action["title"])

Context Layering

scoped = provenance.add_context(resource_type="order", user_id="user-456")

await scoped.log(
    resource_id="order-789",
    action="create",
    uow_id=str(uuid.uuid4()),
    interaction={"total": 99.99},
)

Span Hierarchy

log() returns the generated spanId (a string). Pass it as parent_span_id to link child interactions:

parent_span_id = await provenance.log(
    resource_type="order",
    resource_id="order-789",
    action="create",
    uow_id=uow_id,
    interaction={"total": 99.99},
)

await provenance.log(
    resource_type="payment",
    resource_id="payment-456",
    action="process",
    uow_id=uow_id,
    parent_span_id=parent_span_id,
    interaction={"method": "card"},
)

You can also propagate parent_span_id via context:

child = provenance.add_context(parent_span_id=parent_span_id)
await child.log(resource_id="item-1", action="reserve", ...)

See the full docs for more details.

Configuration

Option Required Description
api_key Yes Your Provenance API key
origin Yes Name of the source system
platform_url No Platform URL (default: https://platform.provenance.dev)
api_url No Override API URL (resolved from platform by default)

Resilience

  • Lazy resolution — Config fetched on first use, not at create() time
  • Retry with backoff — 429/5xx retried up to 3× with exponential backoff
  • Auto-refresh — On 401/403, credentials force-refreshed and retried
  • 5-minute cache — Platform config cached per API key
  • Single dependency — Only requires httpx

License

Proprietary — STDIO Labs

Metadata

Release files for provenance-sdk 1.2.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 provenance-sdk 1.2.0
File Size Uploaded Provenance Actions
provenance_sdk-1.2.0.tar.gz 17.1 kB With provenance Details for provenance_sdk-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for provenance-sdk 1.2.0
File Interpreter ABI Platform Actions
provenance_sdk-1.2.0-py3-none-any.whl Python 3 none any Details for provenance_sdk-1.2.0-py3-none-any.whl

Total release size: 32.2 kB

Release files / provenance_sdk-1.2.0.tar.gz

Download URL provenance_sdk-1.2.0.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
63d1d13571f902f0e288e3712c29f8dfd1c217b8dd57d03072faf996974af11b
BLAKE2b-256 checksum
How to use checksums
28fb615d3c976a2cfffe87a9047319650293fc8840b9b25dee651cb3349d8a08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 5, 2026.

Transparency log

Release files / provenance_sdk-1.2.0-py3-none-any.whl

Download URL provenance_sdk-1.2.0-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b92be43ebcc6a903b183b3eb15920e1938341355b4e70483086e7100fb07ea0
BLAKE2b-256 checksum
How to use checksums
daf90b3ca11bca5c7c33b9aa52b58d85d50507a9ca4d314c40cc3e1a34b15799
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 5, 2026.

Transparency log

Security for provenance-sdk 1.2.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 provenance_sdk-1.2.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 May 5, 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.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files Full 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