OpenStat SDK for AI trading agent telemetry
Project description
openstat Python SDK
Python helpers for sending native OpenStat telemetry from AI trading agents.
pip install openstat-sdk
Add editable starter files to an existing Python project:
openstat init
This creates .env.openstat.example, openstat_integration.py, and
OPENSTAT.md in the current directory. Existing files are preserved unless
you run openstat init --force.
from openstat import OpenStatClient
client = OpenStatClient(
api_key="ostat_...",
endpoint="https://api.openstat.online",
service_name="paper-trader",
environment="production",
)
run = client.start_agent_run(strategy="breakout")
client.record_run_lifecycle(
run_id=run["run_id"],
agent={"id": "agent-1", "name": "Paper Trader"},
status="running",
strategy="breakout",
symbols=["BTC-USD"],
summary="Run started.",
)
client.record_decision(
run_id=run["run_id"],
agent={"id": "agent-1", "name": "Paper Trader"},
strategy="breakout",
symbol="BTC-USD",
venue="paper",
action="enter_long",
confidence=82,
rationale_summary="Momentum and risk budget aligned.",
)
client.record_run_lifecycle(
run_id=run["run_id"],
agent={"id": "agent-1", "name": "Paper Trader"},
status="completed",
strategy="breakout",
symbols=["BTC-USD"],
summary="Run completed.",
)
endpoint defaults to https://api.openstat.online. Set
OPENSTAT_ENDPOINT=http://localhost:4000 only when sending telemetry to a local
OpenStat API during development.
Use record_run_lifecycle(status="completed") or
record_run_lifecycle(status="failed") to settle the matching run on the
OpenStat Runs dashboard. Lifecycle events share the same run_id as decisions,
risk checks, orders, fills, positions, and PnL snapshots.
Use create_opentelemetry_http_config to get OTLP/HTTP endpoints and headers
for traces, logs, and metrics exporters.
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
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 openstat_sdk-0.2.1.tar.gz.
File metadata
- Download URL: openstat_sdk-0.2.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5112a92095ce378bee1296182c0fae06624b8aad9e41d376f9aaba2320744f1c
|
|
| MD5 |
0b9ff249bf51988bdb09ca685f988b43
|
|
| BLAKE2b-256 |
e4edf78424f3d308597a6da6b25e18980f67d7acefde05f241f4828e972c049b
|
Provenance
The following attestation bundles were made for openstat_sdk-0.2.1.tar.gz:
Publisher:
workflow.yml on kezuflow/openstat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openstat_sdk-0.2.1.tar.gz -
Subject digest:
5112a92095ce378bee1296182c0fae06624b8aad9e41d376f9aaba2320744f1c - Sigstore transparency entry: 1704302888
- Sigstore integration time:
-
Permalink:
kezuflow/openstat@2c1ef13df70388ddd79fda1669c798a6ea9ebb72 -
Branch / Tag:
refs/tags/python-sdk-v0.2.1 - Owner: https://github.com/kezuflow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@2c1ef13df70388ddd79fda1669c798a6ea9ebb72 -
Trigger Event:
push
-
Statement type:
File details
Details for the file openstat_sdk-0.2.1-py3-none-any.whl.
File metadata
- Download URL: openstat_sdk-0.2.1-py3-none-any.whl
- Upload date:
- Size: 7.7 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 |
001044fd5b404ba565ac21951f59d499d4b804d701412768cab85e9fc9fc4a72
|
|
| MD5 |
a395e2bffba957f8d70b7cf07e6a4257
|
|
| BLAKE2b-256 |
a24909f9d3181538a32169737db878591ab788149535dc6733182eed09336ebe
|
Provenance
The following attestation bundles were made for openstat_sdk-0.2.1-py3-none-any.whl:
Publisher:
workflow.yml on kezuflow/openstat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openstat_sdk-0.2.1-py3-none-any.whl -
Subject digest:
001044fd5b404ba565ac21951f59d499d4b804d701412768cab85e9fc9fc4a72 - Sigstore transparency entry: 1704302923
- Sigstore integration time:
-
Permalink:
kezuflow/openstat@2c1ef13df70388ddd79fda1669c798a6ea9ebb72 -
Branch / Tag:
refs/tags/python-sdk-v0.2.1 - Owner: https://github.com/kezuflow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@2c1ef13df70388ddd79fda1669c798a6ea9ebb72 -
Trigger Event:
push
-
Statement type: