⚡ PyViz Tutor
A modern, offline execution visualizer for Python. Trace your code step-by-step in a beautiful, dark-mode interface.
🚀 What is it?
PyViz Tutor is a CLI tool that works like https://pythontutor.com/ but runs entirely on your local machine.
It executes your Python script, captures the line-by-line execution flow (variables, stack, output), and generates a single, self-contained HTML file. Perfect for debugging algorithms, teaching programming concepts, or understanding complex logic with a VS Code-inspired visual interface.
✨ Features
- 🔒 100% Offline: No data leaves your machine. Everything runs locally.
- 🎨 Modern UI: Beautiful Dark Mode interface inspired by modern IDEs.
- 📦 Zero-Dependency Output: Generated HTML file has all CSS/JS embedded. Share it easily.
- ⏪ Time Travel: Scrub through execution with slider or play/pause controls.
- 🕵️ Variable Explorer: Watch local variables change state in real-time with color-coded types.
- 🖥️ Standard Output: View
print()statements exactly as they appear during execution.
📦 Installation
Install globally using pip or uv:
# Standard way
pip install pyviz-tutor
# Modern, fast way (Recommended)
uv tool install pyviz-tutor
🎮 Usage
Create a Python script (e.g., recursion.py):
def factorial(n):
if n == 0: return 1
return n * factorial(n-1)
print(factorial(5))
Run the visualizer:
pyviz recursion.py
Your browser will automatically open viz.html showing the trace.
🔧 How it Works
- Tracer: Uses
sys.settraceto record interpreter state at every line. - Serializer: Converts complex objects safely into string representations.
- Bundler: Injects trace data into a pre-built HTML template with a reactive frontend.
🛠️ Development
Want to contribute or modify the source?
# Clone the repo
git clone https://github.com/azmatsiddique/pyviz-tutor.git
cd pyviz-tutor
# Install dependencies using uv
uv venv
uv pip install -e .
# Run tests
pyviz tests/test_script.py
📝 License
Distributed under the MIT License. See LICENSE for details.
Metadata
Release files for pyviz-tutor 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyviz_tutor-0.1.5.tar.gz | 16.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyviz_tutor-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.8 kB
Release files / pyviz_tutor-0.1.5.tar.gz
| Download URL | pyviz_tutor-0.1.5.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc9b1f7af931049f386ba016f965797d16fa785d8eacf3706bebc369d900ca72
|
|
BLAKE2b-256 checksum How to use checksums |
db8ea9617b891b422529f6a2c6a66a7683b512daa5ddcb7593b40424b07e8279
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / pyviz_tutor-0.1.5-py3-none-any.whl
| Download URL | pyviz_tutor-0.1.5-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5d27cb3ee482aaa1a9e111aaa9dc07263fba5070e6e58071f5505d32f800e51
|
|
BLAKE2b-256 checksum How to use checksums |
eab8d2967c3f3d29189fcea32e01d7b9486e7aaf03d6d56cf3769d1e61c113d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|