Local-first crash diagnostics framework for Python. Capture debugging context, redact secrets, inspect crashes offline.
Project description
Safedump
Local-first crash diagnostics for Python.
Capture full debugging context. Redact secrets automatically. Inspect crashes offline.
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
pip install safedump
For the terminal viewer:
pip install safedump[view]
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 │
╰──────────────────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────────────────────────────────────╮
│ main.py:42 in calculate │
╰──────────────────────────────────────────────────────────────────────────────╯
┏━━━━━━━━━━┳━━━━━━┳━━━━━━━┓
┃ Variable ┃ Type ┃ Value ┃
┡━━━━━━━━━━╇━━━━━━╇━━━━━━━┩
│ x │ int │ 42 │
│ y │ int │ 0 │
│ data │ dict │ {...} │
└──────────┴──────┴───────┘
╭─────────────────────────────── Environment ────────────────────────────────╮
│ OS: linux | Python: 3.12.4 | 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__+ExceptionGroupsupport - Thread state — all threads captured, crashing thread highlighted
- Environment — OS, Python version, CWD, env var names
🎨 Developer Experience
- One-line install —
import safedump; safedump.install() - Beautiful terminal viewer — Rich-powered with syntax highlighting
- CLI tools —
view,list,clean,test - Config presets —
configure(preset="production")
🔧 Extensible
- Plugin system —
register_serializer()for custom types - Custom redaction —
RedactionRulefor domain-specific scrubbing before_capturehook — 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 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.
License
MIT © Muneer Alam
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file safedump-1.0.0.tar.gz.
File metadata
- Download URL: safedump-1.0.0.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2bb752b96d878b6b2453b3c8ad4108a50c86a44362bb3a0d02a02cd8bc5ce78
|
|
| MD5 |
25878d54c41ba223a56edb4d12ddafec
|
|
| BLAKE2b-256 |
8aec5b75ed2d5e2b53f0e7224c4e6fb4d352863d3d6f7e250991f304f2893987
|
Provenance
The following attestation bundles were made for safedump-1.0.0.tar.gz:
Publisher:
release.yml on Muneer320/safedump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
safedump-1.0.0.tar.gz -
Subject digest:
f2bb752b96d878b6b2453b3c8ad4108a50c86a44362bb3a0d02a02cd8bc5ce78 - Sigstore transparency entry: 1958071320
- Sigstore integration time:
-
Permalink:
Muneer320/safedump@abd57b49e95a77d8139b4bbbb2ebc533bc4dee03 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Muneer320
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@abd57b49e95a77d8139b4bbbb2ebc533bc4dee03 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file safedump-1.0.0-py3-none-any.whl.
File metadata
- Download URL: safedump-1.0.0-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
600f1dda5b9dbeb2bb65650bdcbb33e87e202bfe1f7ac3c51f93b4706508f870
|
|
| MD5 |
78d43a9cc69292e5ccb06dc4639f2492
|
|
| BLAKE2b-256 |
61c810ca7ed07c9f572698fe29bcc0468bb80ac722040176593182f45762b4c2
|
Provenance
The following attestation bundles were made for safedump-1.0.0-py3-none-any.whl:
Publisher:
release.yml on Muneer320/safedump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
safedump-1.0.0-py3-none-any.whl -
Subject digest:
600f1dda5b9dbeb2bb65650bdcbb33e87e202bfe1f7ac3c51f93b4706508f870 - Sigstore transparency entry: 1958071493
- Sigstore integration time:
-
Permalink:
Muneer320/safedump@abd57b49e95a77d8139b4bbbb2ebc533bc4dee03 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Muneer320
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@abd57b49e95a77d8139b4bbbb2ebc533bc4dee03 -
Trigger Event:
workflow_dispatch
-
Statement type: