Skip to main content

dispatchitapp (Python)

The Python client for Dispatch — error tracking and curated bug reports for the AI-native ticketing system.

The core is stdlib-only, so a bare pip install dispatchitapp is a viable manual-capture SDK (the gem's errors_only analogue). Framework adapters arrive as extras (pip install dispatchitapp[django]) in a later phase.

import dispatchitapp

dispatchitapp.init(
    api_key=os.environ["DISPATCH_API_KEY"],
    environment=os.environ.get("ENV", "production"),
    release=os.environ.get("GIT_SHA"),
)

try:
    do_risky_thing()
except Exception:
    dispatchitapp.capture_exception()          # reads the current exception

# File a curated report (the API-only analogue of the widget):
dispatchitapp.report(description="Nightly import aborted: upstream 502", severity="high")

Process lifecycle (crash capture + shutdown flush)

init() installs the gem's at_exit analogues by default:

  • sys.excepthook — the exception about to kill the process (a crashing script, runner, or worker boot) is reported with source: excepthook, then chained to the previous hook so the native traceback still prints. KeyboardInterrupt is skipped — SIGINT is how process managers ask for a graceful stop, the gem's SIGTERM rule.
  • atexit flush — the send queue drains at exit (up to shutdown_timeout seconds, default 3.0; 0 skips) so shutdowns don't drop just-captured events. An explicit dispatchitapp.flush() is no longer needed before exit.

Opt out per hook with capture_at_exit=False / shutdown_timeout=0, or skip both with init(..., install_lifecycle_hooks=False).

What's in the box

Module Role
config Options → a frozen Config, with the gem's derivations and env gating.
event build_event(exc) → the contract event; cause chain via __cause__/__context__ (≤5, oldest-first), 2000-char message cap.
stacktrace traceback → frames (oldest-first), in_app excludes site-packages/stdlib, source context via linecache.
ticket build_ticket_payload() → the { "ticket": {...} } body.
transport Daemon worker + bounded queue.Queue(maxsize=100), drop-on-overflow, stdlib urllib, never raises.
sampling / dedup rand > rate sampling; WeakSet identity dedup.
client The capture pipeline: gate → dedup → sample → build → before_send → deliver. Never raises.
lifecycle sys.excepthook crash capture + atexit queue flush (the gem's at_exit analogue).

The wire shape is pinned by ../../contract; tests/test_conformance.py validates output against those schemas.

Develop

python3 -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytest            # tests
mypy              # strict typing (src)
ruff check .      # lint

Metadata

Release files for dispatchitapp 1.0.0

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

Source distribution (sdist)

Source distribution for dispatchitapp 1.0.0
File Size Uploaded
dispatchitapp-1.0.0.tar.gz 125.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dispatchitapp 1.0.0
File Interpreter ABI Platform
dispatchitapp-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 148.9 kB

Release files / dispatchitapp-1.0.0.tar.gz

Download URL dispatchitapp-1.0.0.tar.gz
Size 125.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fea9befa28be8a1363c629180b9b875f15a5ababc3b8765a0b34f4d4e353f3c4
BLAKE2b-256 checksum
How to use checksums
8883b06680231b29c0d039178eabd81b5df1a1961fa3d4dd02a1e8918f21e332
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.

Transparency log

Release files / dispatchitapp-1.0.0-py3-none-any.whl

Download URL dispatchitapp-1.0.0-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7af18c8471bb388b3ebf845556f47b5cb377d17b8abbc14ab87f34e7eac5729
BLAKE2b-256 checksum
How to use checksums
c4641f66c0e589514980fbb3c3026cd2c7c0ac02eda48bb2fef64d7a3bd05281
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

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