pydebugviz
Visual Time-Travel Debugging for Python
Trace everything. Watch everything. Export everything.
Overview
pydebugviz captures your Python function’s execution step-by-step and lets you explore it in:
- Jupyter
- Terminal (CLI)
- IDEs
Now in v1.0.1:
- ✅
DebugSessioninteractive navigator - ✅
live_watch()for real-time variable display - ✅
show_summary()for CLI/Jupyter-friendly overview - ✅
export_html()for trace visualization - ✅ Validation tools, safe evaluation, and large var protection
Installation
pip install pydebugviz
Feature Matrix
| Feature | Jupyter | CLI | IDE |
|---|---|---|---|
debug() |
✅ | ✅ | ✅ |
DebugSession |
✅ | ✅ | ✅ |
show_summary() |
✅ | ✅ | ✅ |
export_html() |
✅ | ✅ | ✅ |
live_watch() |
✅ | ✅ | ✅ |
validate_trace() |
✅ | ✅ | ✅ |
Quick Start
from pydebugviz import debug, show_summary
def test():
x = 0
for i in range(4):
x += i
return x
trace = debug(test, breakpoints=["x > 3"], max_steps=100)
show_summary(trace)
Example Output:
[pydebugviz] Trace Summary: 6 steps
- step: 0 | event: call | function: test | line_no: 3
- step: 1 | event: line | function: test | line_no: 4
- step: 2 | event: line | function: test | line_no: 5
- step: 3 | event: line | function: test | line_no: 4
- step: 4 | event: line | function: test | line_no: 5
- step: 5 | event: return | function: test | line_no: 6
Interactive DebugSession
from pydebugviz import DebugSession
session = DebugSession(trace)
session.jump_to(3)
print(session.current())
session.show_summary()
Example Output:
{'event': 'line', 'function': 'test', 'line_no': 4, 'locals': {'x': '3', 'i': '2'}, ...}
[pydebugviz] Trace Summary: 6 steps
- step: 0 | event: call | function: test | line_no: 3
- step: 1 | event: line | function: test | line_no: 4
...
Live Watch Mode
from pydebugviz import live_watch
def my_function():
x = 1
for i in range(3): x += i
live_watch(my_function, watch=["x", "i"], interval=0.1)
Example Output (CLI or Jupyter):*
[Step 1] my_function:3 | x=1, i=<not defined>
[Step 2] my_function:3 | x=1, i=0
[Step 3] my_function:3 | x=1, i=1
[Step 4] my_function:3 | x=2, i=2
Export HTML
from pydebugviz import export_html
export_html(trace, filepath="trace_output.html")
Creates:
A self-contained HTML file with a table of steps, functions, line numbers, and variables.
Just open trace_output.html in your browser.
Validation + Safe Eval
from pydebugviz import validate_expressions, safe_eval
print(validate_expressions(["x > 3", "bad =="])) # syntax check
print(safe_eval("x > 5", {"x": 7})) # safely evaluate
Example Output:
['bad ==']
True
Trace Schema Enforcement
from pydebugviz import normalize_trace, check_trace_schema
normalized = normalize_trace(trace)
issues = check_trace_schema(normalized)
print("Schema issues:", issues)
Example Output:
Schema issues: []
License
MIT License
(c) 2025 pydebugviz contributors
Metadata
Release files for pydebugviz 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydebugviz-1.1.0.tar.gz | 14.7 kB | Without provenance | Details for pydebugviz-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydebugviz-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for pydebugviz-1.1.0-py3-none-any.whl |
Total release size: 27.5 kB
Release files / pydebugviz-1.1.0.tar.gz
| Download URL | pydebugviz-1.1.0.tar.gz |
|---|---|
| Size | 14.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70f6d825c217d0650bf0009bf3a4d7bdbcaaa1c88214f86f92e9a9134063bceb
|
|
BLAKE2b-256 checksum How to use checksums |
76c3bd54d017aeec757a2f4b75d1d8e9894d9e29f3c0c63d85ba09ba722efa55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Release files / pydebugviz-1.1.0-py3-none-any.whl
| Download URL | pydebugviz-1.1.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4862cbebd8f7a6b17c694119137832237807a9a727d897dcbc3846fb6d340bf
|
|
BLAKE2b-256 checksum How to use checksums |
8a37e2470c54d118b78959e7dc25a76b93c13408752a0abecce41c487123a1c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Security for pydebugviz 1.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.