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="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.4

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.4
File Size Uploaded
autotrace_py-0.1.4.tar.gz 10.7 kB Details

Built distribution (wheel)

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

Total release size: 22.0 kB

Release files / autotrace_py-0.1.4.tar.gz

Download URL autotrace_py-0.1.4.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7bbd0fe32ff05629b87e1a65b267ca4238f5ee0849ad224fc8832121b8cfd0a5
BLAKE2b-256 checksum
How to use checksums
95145d09dba64632a5e7c0c7e62fdb0044eaec1295e23262ad03e0bf60cea774
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.4-py3-none-any.whl

Download URL autotrace_py-0.1.4-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ccde1be4b034429addeb4c3a86c909b57a8267bdc01d95f57ef6bbc7e4b15b1
BLAKE2b-256 checksum
How to use checksums
9abedc911cfc730782cbb2f4790e5f9fd56b9733100993978ff753039e069911
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

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

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