OopsTrace Python SDK
LLM observability for Python. Trace every call, span, token count, and cost — visible instantly at app.oopstrace.com.
Install
pip install oopstrace
Quickstart
import oopstrace
oopstrace.init(
api_key="tr_...", # from app.oopstrace.com → project → Access Keys
project_id="...", # your project ID
)
@oopstrace.trace
def run_agent(user_input: str) -> str:
with oopstrace.span("llm-call", span_kind="LLM") as s:
s.set_output("Hello from OopsTrace")
return "Hello from OopsTrace"
run_agent("test")
oopstrace.flush()
Auto-instrument OpenAI / Anthropic
oopstrace.init(api_key="tr_...", project_id="...", auto_instrument=True)
# All openai.chat.completions.create() and anthropic.messages.create()
# calls are now traced automatically — no decorators needed.
Manual spans
@oopstrace.trace
def pipeline(query: str):
with oopstrace.span("retrieval", span_kind="TOOL") as s:
docs = retrieve(query)
s.set_input(query)
s.set_output(str(docs))
with oopstrace.span("generate", span_kind="LLM") as s:
answer = llm(query, docs)
s.set_model("gpt-4o")
s.set_tokens(input=100, output=50)
return answer
Self-hosted
oopstrace.init(
api_key="tr_...",
project_id="...",
endpoint="https://app.yourdomain.com", # point at your own server
)
Metadata
Release files for oopstrace 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oopstrace-0.1.0.tar.gz | 8.3 kB | Without provenance | Details for oopstrace-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oopstrace-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for oopstrace-0.1.0-py3-none-any.whl |
Total release size: 17.6 kB
Release files / oopstrace-0.1.0.tar.gz
| Download URL | oopstrace-0.1.0.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d8c0edfd4f6453f72d82329336797610682b9eee38b9fd2584f8d98ebc919e5f
|
|
BLAKE2b-256 checksum How to use checksums |
f86e6ed803eebeead9f833700d698e604b5c601b9efe82d20d569df4ec6c478d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / oopstrace-0.1.0-py3-none-any.whl
| Download URL | oopstrace-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4958d08df7d8d3772f6bc776b52513dbe2eb5cc3ec1d6e6c55e3a55eada2c843
|
|
BLAKE2b-256 checksum How to use checksums |
3ec778565826f87c0d181b379e1a6ba7af77556c37d5f19dc56750d60c52b284
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for oopstrace 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.