A CLI tool to visualize Python code execution locally.
Project description
The modern, fast way (Recommended)
uv tool install pyviz-tutor 🎮 UsageCreate 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 That's it! Your browser will automatically open viz.html showing the trace.🔧 How it WorksPyViz uses Python's advanced sys.settrace hook to record the state of the interpreter at every line of code.Tracer: The Python engine executes your code and records a "snapshot" of every step (line number, local variables, stdout).Serializer: It handles complex objects safely (converting non-serializable objects like sockets or file handles into string representations).Bundler: It injects this trace data directly into a pre-built HTML template containing a Vue-like reactive frontend.🛠️ DevelopmentIf you want to contribute or modify the source:# Clone the repo git clone https://github.com/yourusername/pyviz-tutor.git cd pyviz-tutor
Install dependencies using uv
uv venv uv pip install -e .
Run tests
pyviz tests/test_script.py 📝 LicenseDistributed under the MIT License. See LICENSE for more information.
Project details
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 pyviz_tutor-0.1.1.tar.gz.
File metadata
- Download URL: pyviz_tutor-0.1.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d76b5e60c7c579f7c550333806ad6bbccf45080be8ceaeeef0dfc48651173ec
|
|
| MD5 |
9f2aa4b4893c7c6be4c354ac169345fc
|
|
| BLAKE2b-256 |
00da2ce3820bc85db094ff28344e064656e37f3c42069421298f6bdc392ec22a
|
File details
Details for the file pyviz_tutor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyviz_tutor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
324a175815a7e0d33d3b3517c6ffa34d57bf76602cad9d9028c81f20455ba877
|
|
| MD5 |
e9e206ea711cd52f42cb468438c9fb07
|
|
| BLAKE2b-256 |
b436f12d795a94a5f75d0787996025d9ff90a907cb009583c0d18372379e9f71
|