AutoTrace Python SDK (autotrace-py)
Lightweight, zero-dependency Python client for autonomous error tracking and AI triage with AutoTrace.
Installation
pip install autotrace
# or from source:
pip install -e ./sdk/python
Quickstart
import autotrace
# 1. Initialize once at application startup
autotrace.init(
api_key="<YOUR_API_KEY>",
endpoint_url="https://autotrace-backend.onrender.com/api/ingest/",
environment="production",
context={"service": "payment-api", "version": "2.1.0"},
)
# 2. Manual Exception Capture
try:
process_order()
except Exception as exc:
autotrace.capture_exception(
exc_info=exc,
endpoint="/api/v1/orders",
context={"user_id": "usr_123"},
)
Function Decorator
@autotrace.trace(endpoint="/jobs/sync-inventory")
def sync_inventory():
# If this raises, AutoTrace captures the error and traceback
perform_risky_task()
Framework Integrations
Django
In your settings.py:
AUTOTRACE_API_KEY = "<YOUR_API_KEY>"
AUTOTRACE_API_URL = "https://autotrace-backend.onrender.com/api/ingest/"
MIDDLEWARE = [
# ... other middleware
"autotrace.middleware.AutoTraceMiddleware",
]
FastAPI / Starlette
In your main.py:
from fastapi import FastAPI
import autotrace
from autotrace.integrations.fastapi import AutoTraceMiddleware
autotrace.init(api_key="<YOUR_API_KEY>")
app = FastAPI()
app.add_middleware(AutoTraceMiddleware)
Metadata
Release files for autotrace-py 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autotrace_py-0.1.3.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autotrace_py-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.1 kB
Release files / autotrace_py-0.1.3.tar.gz
| Download URL | autotrace_py-0.1.3.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7d40211adfc859a3bdf69d837afb605b5b2778917ef520b060792e4e19fb690
|
|
BLAKE2b-256 checksum How to use checksums |
ef9e12b87ff936d59735277f7d13c93681cd8cca75ff0577f21dccfbcdc27641
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.0
|
Release files / autotrace_py-0.1.3-py3-none-any.whl
| Download URL | autotrace_py-0.1.3-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49f5e853133060fac085ab2372a93b70ca049a631544d96fefb0bc41a49b2a7f
|
|
BLAKE2b-256 checksum How to use checksums |
582db64090acc77ab67dd61be2b0f9e463e5e780688f254ec563e4cbb57df5fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.0
|