Skip to main content

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="http://localhost:8000/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_ENDPOINT = "http://localhost:8000/api/ingest/"

MIDDLEWARE = [
    # ... other middleware
    "autotrace.integrations.django.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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autotrace-py 0.1.1
File Size Uploaded
autotrace_py-0.1.1.tar.gz 9.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autotrace-py 0.1.1
File Interpreter ABI Platform
autotrace_py-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 19.8 kB

Release files / autotrace_py-0.1.1.tar.gz

Download URL autotrace_py-0.1.1.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2d2b7f45155d92c5a82aae8fc3027a64cfdaa727f173902371bce5cc14e673e5
BLAKE2b-256 checksum
How to use checksums
1d4f74bdc75656a3fea33b400defddee7442b7c673bd2fe5e792bb3c69022a80
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.1-py3-none-any.whl

Download URL autotrace_py-0.1.1-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6ba7c503a489284c34fa461c4efe8e154090748decc07f6a30b3d4bd1b5a968
BLAKE2b-256 checksum
How to use checksums
17b6e824853f5bb3559e97d4136aeedf2f2543b61259b63ba88b817297aa3f4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release history Release notifications | RSS feed

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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