Skip to main content

bugtape (Python)

Report Python server errors to BugTape, with error messages redacted before they leave your process.

pip install bugtape
import bugtape

bugtape.init(service="analytics")  # key from BUGTAPE_KEY

Each report carries a release, so BugTape can tell a fixed issue from a regression. It is release= if you pass one, else BUGTAPE_RELEASE, DD_VERSION, then the commit your CI or host sets (GITHUB_SHA, VERCEL_GIT_COMMIT_SHA, RENDER_GIT_COMMIT and others; see bugtape.COMMIT_ENV_KEYS).

In a short script, call bugtape.flush() before it ends. It returns True when every report since the last flush was accepted, and False on timeout or when one was rejected or could not be sent (debug=True logs why).

That reports:

  • uncaught exceptions in the main thread and in threads,
  • logging records at ERROR and above (with their exception when there is one),
  • anything you pass to bugtape.capture_exception() or bugtape.capture_message(),
  • uncaught exceptions in Streamlit pages (turned on automatically when Streamlit is imported).

What leaves your server

  • The exception type, a redacted message, and the stack: file, function and line for each frame.
  • Never frame locals or source lines.
  • Redaction replaces quoted values, numbers and amounts, emails, SQL, URLs with credentials, cloud paths and ids. KeyError: 'Acme Pty Ltd' is sent as KeyError: '[redacted]'. Python type names such as 'int' are kept.
  • Redaction works by pattern: a bare name written into a message (f"no rate for {client}") is not recognised. Log arguments (log.error("failed for %s", client)) are never sent.
  • Add your own patterns with extra_redactions=[(r"regex", "[replacement]")], inspect and change every report with before_send=lambda payload: payload, or send only the exception type with send_messages=False.

Streamlit

import streamlit as st
import bugtape

bugtape.init(service="analytics")  # Streamlit is detected; page errors are reported

st.title("Revenue")

Errors still appear in the app exactly as before. Each report names the page and the Streamlit session.

Datadog

If your app runs ddtrace, each report carries the active trace and span ids, and the BugTape console links to the trace in Datadog. BugTape never starts Datadog itself.

Options

Option Default
api_key BUGTAPE_KEY Capture key (bt_live_… / bt_test_…)
service BUGTAPE_SERVICE, DD_SERVICE, app Name of this app
release / environment BUGTAPE_RELEASE, DD_VERSION / BUGTAPE_ENVIRONMENT, DD_ENV
endpoint https://app.bugtape.ai/v1/ingest
redact True Turn message redaction off only for data you know is safe
capture_uncaught / capture_logging True
streamlit auto True to require it, False to skip

Reports are sent from a background thread with a 5 second timeout and at most 30 per minute. BugTape never raises into your app.

Docs: https://bugtape.ai/docs/python/

Metadata

Release files for bugtape 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 bugtape 0.1.1
File Size Uploaded
bugtape-0.1.1.tar.gz 25.9 kB Details

Built distribution (wheel)

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

Total release size: 82.3 kB

Release files / bugtape-0.1.1.tar.gz

Download URL bugtape-0.1.1.tar.gz
Size 25.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0a93592dd2b1451a631df06ae6321059866daf0a7f4ce6c7ffeeb3bffc0982ee
BLAKE2b-256 checksum
How to use checksums
c30b0233e5eeb6b56de1fdc294620adbf61ba12b3a24d782c40ed757719f5e8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

Release files / bugtape-0.1.1-py3-none-any.whl

Download URL bugtape-0.1.1-py3-none-any.whl
Size 56.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
927ebb984dada798c8162ed85e7cb749e37b83a5b9e99fc28b5ba6a3299080d6
BLAKE2b-256 checksum
How to use checksums
8cb951baf1ffdc1c3e53da7d97fccf420d9f943df1d1b4d66cfa4b4ef00a6f7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 1, 2026.

Transparency log

Release history Release notifications | RSS feed

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