Skip to main content

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

Project description

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

Project details


Download files

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

Source Distribution

dispatchitapp-1.0.0.tar.gz (125.3 kB view details)

Uploaded Source

Built Distribution

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

dispatchitapp-1.0.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file dispatchitapp-1.0.0.tar.gz.

File metadata

  • Download URL: dispatchitapp-1.0.0.tar.gz
  • Upload date:
  • Size: 125.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dispatchitapp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fea9befa28be8a1363c629180b9b875f15a5ababc3b8765a0b34f4d4e353f3c4
MD5 782deff715c2981b10eab1c881de1376
BLAKE2b-256 8883b06680231b29c0d039178eabd81b5df1a1961fa3d4dd02a1e8918f21e332

See more details on using hashes here.

Provenance

The following attestation bundles were made for dispatchitapp-1.0.0.tar.gz:

Publisher: release-python.yml on Recursivity-LLC/dispatch-sdks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dispatchitapp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: dispatchitapp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dispatchitapp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7af18c8471bb388b3ebf845556f47b5cb377d17b8abbc14ab87f34e7eac5729
MD5 13ccb74f456d0481604f2c158fb91a6a
BLAKE2b-256 c4641f66c0e589514980fbb3c3026cd2c7c0ac02eda48bb2fef64d7a3bd05281

See more details on using hashes here.

Provenance

The following attestation bundles were made for dispatchitapp-1.0.0-py3-none-any.whl:

Publisher: release-python.yml on Recursivity-LLC/dispatch-sdks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page