Skip to main content

English | 简体中文

⏪ RewindPy

Your Python program crashed. Rewind it.

A local, post-crash time-travel debugger for Python.

CI PyPI Python 3.10+ License: MIT Live Demo

RewindPy demo

Open the live interactive report

RewindPy records a bounded history of project-local execution events. When an uncaught exception occurs, it writes a self-contained HTML report that lets you move backward through source lines, local values, and variable changes.

Try it in one minute

python -m pip install --upgrade rewindpy
rewindpy doctor
rewindpy demo --open

rewindpy doctor checks the interpreter, output permissions, and a complete built-in report smoke test. The demo intentionally crashes, generates rewindpy-demo.html, and exits successfully so you can explore the report immediately.

Debug your own script

rewindpy run --open app.py

# Force Chinese or English output
rewindpy --lang zh run --open app.py
rewindpy --lang en run --open app.py

Choose the report path and pass arguments to the target program:

rewindpy run --output crash.html app.py -- --port 8080

A crashing target keeps its original non-zero exit code, which makes RewindPy suitable for local scripts and CI reproductions.

What v0.1.1 can do

  • Rewind call, line, return, and exception events.
  • Inspect source, locals, and per-step value changes.
  • Open a focused Crash Slice instead of thousands of unrelated events.
  • Trace a missing dictionary key back to the step where it disappeared.
  • Suggest likely key renames such as user_id → userid.
  • Trace a NoneType crash back to an assignment or function returning None.
  • Jump directly from the crash to the likely value origin.
  • Keep reports local and redact common secret names.

Safe tracing

rewindpy run --max-events 5000 --include src --exclude tests app.py

RewindPy keeps the newest events in a bounded ring buffer, preserves the crash tail, skips common environment/build directories by default, and shows retained/discarded event statistics in the report. Both --include and --exclude may be repeated.

Safe Tracing: report-size protection

rewindpy run --max-events 5000 --max-report-mb 10 app.py

RewindPy compresses repeated loops and prioritizes crash slices, exception events, and value origins when a report exceeds its budget.

pytest integration

After installing RewindPy in your test environment, generate a local report for every failed test:

pytest --rewind
pytest --rewind --rewind-dir reports --rewind-lang zh

Passing tests do not create reports. Failed-test reports are written to .rewindpy/ by default, while pytest keeps its original output and exit code.

Built-in demos

rewindpy demo none-origin --open
rewindpy demo key-error --open
rewindpy demo crash-slice --open

Command reference

rewindpy --version
rewindpy --lang zh --help
rewindpy doctor [--json]
rewindpy [--lang auto|en|zh] demo [none-origin|key-error|crash-slice] [--output FILE] [--open]
rewindpy [--lang auto|en|zh] run SCRIPT [--output FILE] [--max-events N] [--open] [-- ARGS...]

The CLI auto-detects Chinese locales. You can also set REWINDPY_LANG=zh or use --lang zh. Generated reports include an EN / 中文 switch.

Current scope

RewindPy v0.1.1 targets Python 3.10+, single-threaded local scripts, uncaught exceptions, and files under the target script's directory.

It is not deterministic replay. It does not yet model async task causality, multiprocessing, native extensions, live breakpoints, or arbitrary mutation inside opaque objects.

Safety

Crash reports can contain runtime data. RewindPy writes them locally and redacts variable or dictionary keys containing names such as password, token, secret, and api_key. Always review a report before sharing it.

Development

python -m pip install -e ".[dev]"
python -m ruff check .
python -m pytest -q
rewindpy doctor
python -m build
python -m twine check dist/*

See CONTRIBUTING.md to contribute, SECURITY.md for private vulnerability reporting, RELEASING.md for the release process, and CHANGELOG.md for version history.

License

RewindPy is licensed under the MIT License.

Download files

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

Source Distribution

rewindpy-0.1.1.tar.gz (41.1 kB view details)

Uploaded Source

Built Distribution

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

rewindpy-0.1.1-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file rewindpy-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for rewindpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 abfe3bac66ae9efe1041e3b1cd2d32a122dcce85c5e64a1b42cda446a6a092d2
MD5 9f636e68ce44745216098057bd716b86
BLAKE2b-256 3ef1efa1c2925efa61b0d6722a6ab3e2b57b27a5a44f9885213d797924a2a575

See more details on using hashes here.

Provenance

The following attestation bundles were made for rewindpy-0.1.1.tar.gz:

Publisher: release.yml on LIRuixuan0407/rewindpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rewindpy-0.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for rewindpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03f21872f1bc34345a17d751201f452a41f827dd6fa6714c417a5d853ae2f95d
MD5 2da27e670415b2dd0d63a4a8bd16c71f
BLAKE2b-256 11d36e01734f51a7020ccbebdca20251588be08366c8b337a38c3c1bfb41b442

See more details on using hashes here.

Provenance

The following attestation bundles were made for rewindpy-0.1.1-py3-none-any.whl:

Publisher: release.yml on LIRuixuan0407/rewindpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 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