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)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autotrace_py-0.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autotrace_py-0.1.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file autotrace_py-0.1.0.tar.gz.

File metadata

  • Download URL: autotrace_py-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.0

File hashes

Hashes for autotrace_py-0.1.0.tar.gz
Algorithm Hash digest
SHA256 324cce80258c3186bf885fb9b77d23aa61acc6b1255f6e186d23ea6d0a18e765
MD5 975e25b9f92ab8d5b7fd3e59a15a0624
BLAKE2b-256 1a570e2cba259ba6307a33ab93c3683b243f1110f9ad4916864840d74ffa1fb1

See more details on using hashes here.

File details

Details for the file autotrace_py-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: autotrace_py-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.0

File hashes

Hashes for autotrace_py-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 165f417b5dacbd6c153d0826deef6ca97ae7cb137c818e3b47661aaa9522ef8b
MD5 660ed90322a9652ef695f8d32235e2ab
BLAKE2b-256 daa98b378626bf9dd2b996d11260371ebcd63e78dfa878de74ff6561881d14f6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 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