Skip to main content

Safedump

Safedump terminal output

Debug crashes without reproducing them.
Local-first crash reports with automatic secret redaction.

PyPI Release CI Python Downloads License REUSE


What is Safedump?

Python's traceback tells you where your code crashed. Safedump tells you why.

When an exception occurs, Safedump captures the complete debugging context — local variables, exception chains, thread state, environment — and saves it as a structured, safe-to-share crash report. No cloud. No telemetry. No network calls. Ever.

import safedump

safedump.install()
# ... your application runs, crashes ...
# Crash report saved: ~/.safedump/crash-2026-06-25-123456-TypeError-a1b2c3.safedump.json

Then inspect it anytime:

safedump view              # Terminal (Rich)
safedump view --html       # Self-contained HTML file
safedump serve             # Local web browser UI

Why Safedump?

Problem Without Safedump With Safedump
"It crashed on the server" Ask user for logs, try to reproduce Open the crash report file
"What were the variable values?" Add print() statements, redeploy Already captured in the report
"Can I share this crash safely?" Manually audit for secrets first Automatic redaction built in
"Which thread crashed?" Guess from log timestamps Thread state captured at crash time
"Works on my machine" SSH in, check environment Environment metadata in every report

Quick Start

Installation

pip install safedump[view]    # with Rich terminal viewer
pip install safedump           # minimal (no dependencies)

One-line setup

import safedump

safedump.install()

That's it. Every unhandled exception now produces a crash report.

Manual capture

try:
    result = dangerous_operation()
except Exception:
    path = safedump.capture_exception()
    print(f"Crash captured: {path}")
    raise

Features

🔒 Privacy First

  • Zero cloud — no network calls, no telemetry, no accounts
  • Secret redaction — denylist (variable names) + regex (credentials) + entropy-based detection
  • Privacy tiers — configure exactly what gets captured (levels 0-4)
  • File permissions — reports saved with 0600 (owner-only)

📋 Rich Debugging Context

  • Local variables — values and types at every stack frame
  • Exception chains — full __cause__ + ExceptionGroup support
  • Thread state — all threads captured, crashing thread highlighted
  • Environment — OS, Python version, CWD, env var names

🎨 Developer Experience

  • One-line installimport safedump; safedump.install()
  • Beautiful terminal viewer — Rich-powered with syntax highlighting
  • Self-contained HTML exportsafedump view --html report.html
  • Local web serversafedump serve for browsing reports in the browser
  • CLI filteringsafedump list --type KeyError --since 7d --search error
  • Crash statisticssafedump stats for aggregate data
  • Diagnosticssafedump doctor checks configuration integrity
  • Config presetsconfigure(preset="production")

🔧 Extensible

  • Custom serializationregister_serializer() for non-standard types
  • Custom redactionRedactionRule for domain-specific scrubbing
  • before_capture hook — pre-processing before report generation
  • on_crash hook — callback invoked after each capture (file notification, etc.)
  • pytest integration — auto-capture on test failures
  • Click/Typer integration@wrap_click() decorator

CLI Reference

safedump view [file]              # View crash report (Rich terminal)
safedump view --json [file]        # View as raw JSON
safedump view --html [output]      # Export as self-contained HTML
safedump list [--count] [--type] [--since] [--search]
safedump stats                     # Aggregate crash statistics
safedump doctor [--verbose]        # Diagnose common issues
safedump serve [--port] [--host]   # Start local web server
safedump clean --older-than DAYS   # Delete old reports
safedump test                      # Verify installation

Configuration

safedump.configure(
    preset="production",  # "development", "debug", "minimal"
    output_dir="./crashes",
    privacy_tier=1,  # 0=minimal, 1=default, 4=everything
    enable_entropy_detection=True,  # Shannon entropy-based secret detection
    compress=True,  # Gzip compressed crash reports
    on_crash=my_notification_handler,  # Callback after each capture
)

Documentation

Full documentation at safedump.dev (coming with v2.0).

Supported Platforms

Platform Status Notes
Linux Primary development platform
macOS Fully supported
Windows Verified on Windows 11, Python 3.13

Python versions: 3.9 through 3.13.

Contributing

Contributions are welcome! See CONTRIBUTING.md for development setup and guidelines.

Looking for a place to start? Check out open issues with the good first issue label.

License

MIT © Muneer Alam

Download files

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

Source Distribution

safedump-2.0.0.tar.gz (71.4 kB view details)

Uploaded Source

Built Distribution

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

safedump-2.0.0-py3-none-any.whl (45.8 kB view details)

Uploaded Python 3

File details

Details for the file safedump-2.0.0.tar.gz.

File metadata

  • Download URL: safedump-2.0.0.tar.gz
  • Upload date:
  • Size: 71.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for safedump-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b7b18c18844b3e093085f05cc7f09b6313d4066b98ecd3d5c835c0e0bca5460a
MD5 bf8ddc5748be2cdda1353cff62612a19
BLAKE2b-256 6762bb0888588b6079c8bd0ec0156a1e3a48097e1b9176272f4b75e0bd77bb22

See more details on using hashes here.

File details

Details for the file safedump-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: safedump-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 45.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for safedump-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab7dea0986f73a4f3e18c4c9a1e04664822df30d4699848a43cc06773415ab64
MD5 3ff67380e02c96c8b97e7b3fb6148077
BLAKE2b-256 99e24972ae49a57dad51ff6fff6ffa3c3976646037fdc421f18a43d918b98e9e

See more details on using hashes here.

Supported by

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