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 Python execution. After an uncaught exception, it writes one self-contained HTML debugging workspace for source code, local values, changes, call stacks, exception causes, and the execution timeline.

Try it in one minute

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

What v0.2.0 adds

  • Navigate every captured source file with a project-style file explorer.
  • Follow timeline events, call-stack frames, value origins, and exception causes across files.
  • Open files with Ctrl+P, search the current file with Ctrl+F, and search the whole report with Ctrl+Shift+F.
  • Inspect explicit raise ... from ... causes, implicit exception contexts, from None, notes, and nested tracebacks.
  • Validate report data through Schema v2 and an embedded SHA-256 integrity digest.
  • Exercise the real report UI in Chromium during CI and track report-generation performance.

Debug your own script

rewindpy run --open app.py
rewindpy --lang zh run --open app.py
rewindpy run --output crash.html app.py -- --port 8080

A crashing target keeps its original non-zero exit code. Reports are local HTML files and do not require a server.

Report workspace

The report combines:

  • a bounded execution timeline with play, pause, step, and speed controls;
  • complete captured source files with current, crash, origin, and search highlights;
  • local variables and per-step changes;
  • a clickable call stack and exception chain;
  • Crash Slice, missing-key origin, likely key rename, and None-origin analysis;
  • English and Simplified Chinese UI, dark/light themes, copy diagnostics, and VS Code source links.

Built-in demos

rewindpy demo none-origin --open
rewindpy demo key-error --open
rewindpy demo crash-slice --open
rewindpy demo exception-chain --open
rewindpy demo multi-file --open

pytest integration

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 normal output and exit code.

Safe tracing

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

RewindPy uses a bounded ring buffer, skips common environment and build directories, compresses repeated loops, preserves crash-critical events, and records retained/discarded statistics.

Command reference

rewindpy --version
rewindpy --lang auto|en|zh --help
rewindpy doctor [--json]
rewindpy [--lang auto|en|zh] demo [none-origin|key-error|crash-slice|exception-chain|multi-file] [--output FILE] [--open]
rewindpy [--lang auto|en|zh] run SCRIPT [--output FILE] [--max-events N] [--include PATH] [--exclude PATH] [--max-report-mb MB] [--open] [-- ARGS...]

Development and quality gates

python -m pip install -e ".[dev,e2e]"
python -m ruff check .
python -m pytest -q
python -m playwright install chromium
REWINDPY_REQUIRE_BROWSER_E2E=1 python -m pytest -q tests/e2e
python benchmarks/report_benchmark.py --events 5000 --iterations 3
python scripts/build_live_demo.py --check
rewindpy doctor

See browser testing, performance, report schema, exception chains, and multi-file navigation.

Current scope

RewindPy v0.2.0 targets Python 3.10+, single-threaded local scripts, uncaught exceptions, pytest failures, and Python files under the traced project root.

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.

See CONTRIBUTING.md, SECURITY.md, RELEASING.md, and CHANGELOG.md.

License

RewindPy is licensed under the MIT License.

Metadata

Release files for rewindpy 0.2.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 rewindpy 0.2.0
File Size Uploaded
rewindpy-0.2.0.tar.gz 58.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rewindpy 0.2.0
File Interpreter ABI Platform
rewindpy-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 108.0 kB

Release files / rewindpy-0.2.0.tar.gz

Download URL rewindpy-0.2.0.tar.gz
Size 58.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a828529d7fa47ec476b445290419f1aeae6742fc4dbe708706999c8d39b13286
BLAKE2b-256 checksum
How to use checksums
c7110d9823267f4a5ac6855b4da50ae2e08f0818fea093371a3e444468c32649
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 7, 2026.

Transparency log

Release files / rewindpy-0.2.0-py3-none-any.whl

Download URL rewindpy-0.2.0-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6ecaf5bd01d42c43f17956a00c8dd05be19ef16a28e5faba2819fa7bbfdafe7
BLAKE2b-256 checksum
How to use checksums
bf82437040e08263ada472136b1f6e02df87e81475843a6a8e590f49984c12e9
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 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

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