Python SDK for the Provenance platform — queue ingestion and full REST API client
Project description
Provenance SDK (Python)
Python SDK for the Provenance platform — queue-based ingestion and full async REST API client.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file provenance_sdk-1.1.0.tar.gz.
File metadata
- Download URL: provenance_sdk-1.1.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
482cfdca1b0201d130f26f12dd09b2ce2b56c56ea6939e7599543deb3cfe9492
|
|
| MD5 |
f3f968aaa44d9294df61f050b0609578
|
|
| BLAKE2b-256 |
ea1ec85161614d05c9ceda09d4368d6dee69029a98aca5d45871a0ff6686d110
|
Provenance
The following attestation bundles were made for provenance_sdk-1.1.0.tar.gz:
Publisher:
publish-python.yml on stdiolabs/provenance_sdk_python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
provenance_sdk-1.1.0.tar.gz -
Subject digest:
482cfdca1b0201d130f26f12dd09b2ce2b56c56ea6939e7599543deb3cfe9492 - Sigstore transparency entry: 1347157750
- Sigstore integration time:
-
Permalink:
stdiolabs/provenance_sdk_python@8505849e28117a9361001219845fb8f47f2ba786 -
Branch / Tag:
refs/tags/v1.1.0-beta - Owner: https://github.com/stdiolabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@8505849e28117a9361001219845fb8f47f2ba786 -
Trigger Event:
release
-
Statement type:
File details
Details for the file provenance_sdk-1.1.0-py3-none-any.whl.
File metadata
- Download URL: provenance_sdk-1.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11f488e661dcf39d03396dfdd0c1d6ae06f51630706b323a186ebd82ce999e82
|
|
| MD5 |
ce0758cf41d78e463fcbd63cf984440f
|
|
| BLAKE2b-256 |
175532c14ef4b06d36fb1c7dca88de24b45705d2e1a3bc960304800f81432374
|
Provenance
The following attestation bundles were made for provenance_sdk-1.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on stdiolabs/provenance_sdk_python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
provenance_sdk-1.1.0-py3-none-any.whl -
Subject digest:
11f488e661dcf39d03396dfdd0c1d6ae06f51630706b323a186ebd82ce999e82 - Sigstore transparency entry: 1347157847
- Sigstore integration time:
-
Permalink:
stdiolabs/provenance_sdk_python@8505849e28117a9361001219845fb8f47f2ba786 -
Branch / Tag:
refs/tags/v1.1.0-beta - Owner: https://github.com/stdiolabs
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@8505849e28117a9361001219845fb8f47f2ba786 -
Trigger Event:
release
-
Statement type: