Skip to main content

booboo-sdk

CI PyPI version Python versions License: MIT

Official Python SDK for booboo.dev error tracking.

Installation

pip install booboo-sdk

Quick Start

import booboo

booboo.init("https://YOUR_TOKEN@ingest.booboo.dev/your-org/your-project")

That's it. Unhandled exceptions are automatically captured and sent to booboo.dev.

The DSN is a URL — the SDK parses out the ingest host so you don't need to configure an endpoint separately. Bare tokens (e.g. "abc123...") are also accepted for back-compat with older dashboards.

Manual Capture

try:
    risky_operation()
except Exception:
    booboo.capture_exception()  # captures the current exception

Or pass an exception explicitly:

try:
    risky_operation()
except Exception as e:
    booboo.capture_exception(e)

User Context

booboo.set_user(
    {
        "id": "123",
        "email": "user@example.com",
        "username": "alice",
    }
)

Framework Integration

Django

Auto-detected — no extra setup needed. The SDK injects middleware and patches Django's internal exception handler to capture errors that never reach middleware (like DisallowedHost). 404 errors are filtered by default.

Flask

from flask import Flask
import booboo

app = Flask(__name__)
booboo.init("https://YOUR_TOKEN@ingest.booboo.dev/your-org/your-project", app=app)

Or without passing app — the SDK monkey-patches Flask.__init__ to auto-register on any Flask app created after init(). 404 errors are filtered by default.

FastAPI

from fastapi import FastAPI
import booboo

app = FastAPI()
booboo.init("https://YOUR_TOKEN@ingest.booboo.dev/your-org/your-project", app=app)

Same auto-detection as Flask if app is not passed explicitly.

Configuration

booboo.init(
    dsn="https://YOUR_TOKEN@ingest.booboo.dev/your-org/your-project",
    environment="production",
    release="1.4.2",
    ignore_errors=[KeyboardInterrupt, ConnectionError],
)
Parameter Default Description
dsn (required) Your project's DSN from booboo.dev
app None Flask/FastAPI app instance for explicit registration
environment "" Environment name (e.g. "production", "staging"). Attached to every event.
release BOOBOO_RELEASE env var, or "" Release/version identifier (e.g. a git SHA or "1.4.2"). Attached to every event; powers "introduced in release X" on issues.
ignore_errors None List of exception classes to suppress. Uses isinstance() so subclasses are matched.
endpoint derived from DSN URL, or https://ingest.booboo.dev/ Override the ingest endpoint. Normally unnecessary — the SDK derives it from the DSN URL automatically.
debug False Log every send/drop on the booboo logger (also BOOBOO_DEBUG=1). Rejected or undeliverable events are always logged as warnings, rate-limited to one per minute per cause.
before_send None Hook called with the event dict before every send. Return the (possibly modified) event, or None to drop it. If the hook raises, the event is dropped.

before_send Hook

Use before_send to inspect or modify events before they leave your server. Return the event to send it, or None to drop it:

def drop_health_checks(event):
    if "/healthz" in event.get("message", ""):
        return None  # drop
    return event


booboo.init(
    dsn="https://YOUR_TOKEN@ingest.booboo.dev/your-org/your-project",
    before_send=drop_health_checks,
)

The hook receives every event (exceptions and capture_message() calls alike) and runs on the SDK's background sender thread, so it never adds latency to your request path. If the hook raises, the event is dropped — never sent unmodified.

Value-level PII scrubbing

The SDK already scrubs sensitive variables by name (password, token, …), but only your code knows which values are sensitive. A thorough scrubber must visit every place values appear: the message, the top-level stacktrace's variables, and each chained exception's message and frames:

import re

IBAN_RE = re.compile(r"\b[A-Z]{2}\d{2}[A-Z0-9]{10,30}\b")


def scrub_ibans(event):
    all_frames = list(event.get("stacktrace", []))
    for exc in event.get("exceptions", []):
        all_frames.extend(exc.get("stacktrace", []))
        exc["value"] = IBAN_RE.sub("[iban]", exc.get("value", ""))
    for frame in all_frames:
        for name, value in frame.get("vars", {}).items():
            frame["vars"][name] = IBAN_RE.sub("[iban]", value)
    event["message"] = IBAN_RE.sub("[iban]", event.get("message", ""))
    return event


booboo.init(
    dsn="https://YOUR_TOKEN@ingest.booboo.dev/your-org/your-project",
    before_send=scrub_ibans,
)

Features

  • Automatic capture of unhandled exceptions
  • Rich stack traces with source context and local variables
  • Exception chain support (raise ... from ...)
  • PII scrubbing for sensitive headers and variables
  • Django, Flask, and FastAPI integrations
  • Non-blocking event delivery
  • Graceful shutdown flush
  • Minimal dependency footprint (requests only)

License

MIT

Metadata

Release files for booboo-sdk 0.15.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 booboo-sdk 0.15.0
File Size Uploaded
booboo_sdk-0.15.0.tar.gz 19.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for booboo-sdk 0.15.0
File Interpreter ABI Platform
booboo_sdk-0.15.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.1 kB

Release files / booboo_sdk-0.15.0.tar.gz

Download URL booboo_sdk-0.15.0.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6a92716116882dccbeec8fa23ea0dd2aeb5405bd8b526c91204900f35b3a2f20
BLAKE2b-256 checksum
How to use checksums
b37f90fe2d5b040a07b7b5949c6064609f636994f326b52a6db40c607c4b69cd
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 Aug 20, 2026.

Transparency log

Release files / booboo_sdk-0.15.0-py3-none-any.whl

Download URL booboo_sdk-0.15.0-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e648fbe87581306ca0ee05b2df9a8c06768621a79c7ac781e032ed12b98868f
BLAKE2b-256 checksum
How to use checksums
f98514526846599c74d67a0342b9ffd1f875afe09332b6cfeeefa9e2765e7d3c
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 Aug 20, 2026.

Transparency log

Release history Release notifications | RSS feed

0.16.0

2 release files

This release

0.15.0 This release

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.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