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


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

Then inspect it anytime:

$ safedump view

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

How is it different?

Feature safedump rich.traceback stackprinter Sentry SDK
Local-first ❌ (cloud)
Offline crash reports ✅ (JSON files)
Secret redaction ✅ (built-in) ✅ (configurable)
CLI viewer ✅ (terminal)
Privacy tiers ✅ (0–4)
Plugin system
ExceptionGroup support
Cross-thread capture
Shareable reports ❌ (plain text) ❌ (plain text) ✅ (cloud only)

Quick Start

Installation

For the full experience (terminal viewer):

pip install safedump[view]

Minimal install (no dependencies):

pip install safedump

One-line setup

import safedump
safedump.install()

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

What a crash report looks like

$ safedump view
╭───────────────────────────────── Exception ──────────────────────────────────╮
│ ZeroDivisionError: division by zero                                          │
╰──────────────────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────────────────────╮
│ app.py:13 in <module>                                                        │
╰──────────────────────────────────────────────────────────────────────────────╯
┏━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Variable  ┃ Type     ┃ Value                          ┃
┡━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ safedump  │ module   │ <module 'safedump'>            │
│ calculate │ function │ <function calculate at 0x...>  │
└───────────┴──────────┴────────────────────────────────┘
╭──────────────────────────────────────────────────────────────────────────────╮
│ app.py:10 in calculate                                                       │
╰──────────────────────────────────────────────────────────────────────────────╯
┏━━━━━━━━━━┳━━━━━━┳━━━━━━━┓
┃ Variable ┃ Type ┃ Value ┃
┡━━━━━━━━━━╇━━━━━━╇━━━━━━━┩
│ orders   │ list │ []    │
│ total    │ int  │ 0     │
└──────────┴──────┴───────┘
╭─────────────────────────────── Environment ────────────────────────────────╮
│ OS: posix | Python: 3.11 | Platform: linux | CWD: /app                     │
╰─────────────────────────────────────────────────────────────────────────────╯

Manual capture

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

Features

🔒 Privacy First

  • Zero cloud — no network calls, no telemetry, no accounts
  • Secret redaction — passwords, tokens, and API keys automatically scrubbed
  • Privacy tiers — configure exactly what gets captured
  • 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
  • CLI toolsview, list, clean, test
  • Config presetsconfigure(preset="production")

🔧 Extensible

  • Plugin systemregister_serializer() for custom types
  • Custom redactionRedactionRule for domain-specific scrubbing
  • before_capture hook — pre-processing before report generation

Configuration

safedump.configure(
    preset="production",      # or "development", "debug", "minimal"
    output_dir="./crashes",   # where to save reports
    privacy_tier=1,           # 0=minimal, 1=default, 4=everything
)

CLI Commands

safedump view                    # View latest crash report
safedump view crash.json         # View specific report
safedump view --json             # View as raw JSON (pipe to jq)
safedump list                    # List recent crashes
safedump list --count 10         # Last 10 crashes
safedump clean --older-than 30   # Delete reports older than 30 days
safedump test                    # Verify installation

FAQ

Does Safedump send data anywhere? No. Safedump is completely offline. It never makes network connections. Crash reports are stored locally on your filesystem.

Is it safe to share crash reports? Yes (after review). By default, Safedump redacts variable names like password, token, and secret, and detects credential patterns (AWS keys, GitHub tokens, JWTs). The report includes a redaction audit trail. Still, always review before sharing publicly.

What's the performance overhead? Zero during normal execution. Safedump only runs when an unhandled exception occurs. Crash capture takes <30ms for typical 20-frame tracebacks.

What Python versions? 3.9 through 3.13. Tested on all versions in CI.

Can I use this in production? Yes. Use configure(preset="production") (privacy tier 1, no env capture, no argv). Safedump is designed to fail gracefully — if the handler itself crashes, the original traceback is always preserved.

Supported Python Versions

Python Status
3.9
3.10
3.11
3.12
3.13

Roadmap

  • v1.1 — HTML export, safedump serve, entropy-based redaction
  • v1.2 — Windows first-class support, logging integration
  • v1.3 — Framework guides (Flask, FastAPI, Django)
  • v2.0 — Plugin ecosystem, third-party type packages

See ROADMAP.md for details.

Contributing

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

Looking for a place to start? Check out good first issues.

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-1.1.0.tar.gz (37.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-1.1.0-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for safedump-1.1.0.tar.gz
Algorithm Hash digest
SHA256 872d4732035a2835e6ca4f60193a42798b88b648a879e56f1651f4ba46ac4f11
MD5 2d1010e99323b7eed41bec28e4e767bb
BLAKE2b-256 65d7f41968848718d291dd26452e13f0367d7857e0cf7d126b40763f23120439

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for safedump-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c499134ec947810a40a7712670bf70b11e8871e6e1fe1eeebcaded52fcdd56bb
MD5 5a6892c0c0cf7a79af506f7d5a2a06e9
BLAKE2b-256 18018c4da22fea278c68b18f9d9b9dbf0a6ad2f6b32c902c1ca70bb967a020ff

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