Real-Time Code Execution Visualizer for Python
Project description
Code2Flow Visualizer ๐
Real-Time Code Execution Visualizer for Python
๐ Now available on PyPI! Install with
pip install code2flow-visualizer
Code2Flow Visualizer is a powerful debugging and visualization library that generates interactive flowcharts of Python code execution. Watch your variables change step-by-step and understand complex logic flow like never before.
โจ Features
- ๐ Step-by-step execution visualization - See how variables change during code execution
- ๐ Interactive flowcharts - Navigate through execution paths visually
- ๐ Jupyter Notebook integration - Works seamlessly in your favorite environment
- ๐จ Multiple export formats - Export to Mermaid.js, Graphviz, PNG, SVG
- ๐ Real-time debugging - Like Python Tutor but more powerful and flexible
- ๐ง Customizable visualization - Configure colors, layout, and display options
๐ Quick Start
pip install code2flow-visualizer
Basic Usage
from code2flow import visualize
@visualize
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)
# This will generate an interactive flowchart
result = fibonacci(5)
Jupyter Notebook
from code2flow import FlowVisualizer
visualizer = FlowVisualizer()
visualizer.track_function(your_function)
visualizer.display() # Shows interactive widget
Export Options
from code2flow import CodeFlow
flow = CodeFlow()
flow.trace(your_code)
flow.export_mermaid("flowchart.md")
flow.export_graphviz("flowchart.dot")
flow.export_image("flowchart.png")
๐ ๏ธ Installation
Basic Installation
pip install code2flow-visualizer
Development Installation
pip install code2flow-visualizer[dev]
With Mermaid Support
pip install code2flow-visualizer[mermaid]
๐ Documentation
๐ฏ Why Code2Flow Visualizer?
Traditional debugging tools show you where your code fails, but Code2Flow Visualizer shows you how your code behaves. Perfect for:
- Understanding complex algorithms
- Teaching programming concepts
- Debugging recursive functions
- Visualizing data flow in applications
- Code reviews and documentation
๐ Example Output
โโโโโโโโโโโโโโโโโโโ
โ fibonacci(5) โ
โ n = 5 โ
โโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ n > 1 ? โ
โ True โ
โโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโ
โ fibonacci(4) + โ
โ fibonacci(3) โ
โโโโโโโโโโโโโโโโโโโ
๐ License
MIT License - see LICENSE file for details.
๐โโ๏ธ Support
- ๐ Report bugs
- ๐ก Request features
- ๐ฌ Join discussions
Made with โค๏ธ for the Python community
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 code2flow_visualizer-0.8.6.tar.gz.
File metadata
- Download URL: code2flow_visualizer-0.8.6.tar.gz
- Upload date:
- Size: 26.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8a62e63a3e32d6821d03918cb1697a60cbaaba95c2fcead93fb84248d90ed81
|
|
| MD5 |
5fb6aa63479eaf9cc62790083a1cd4b2
|
|
| BLAKE2b-256 |
9ff1eef87c9b138ab3ea9f7b59f9b27f5ddd844d9a47eb79b089a44496936d5a
|
File details
Details for the file code2flow_visualizer-0.8.6-py3-none-any.whl.
File metadata
- Download URL: code2flow_visualizer-0.8.6-py3-none-any.whl
- Upload date:
- Size: 29.5 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 |
4d728e13f2c043370551a4aea14cf86054e51362fd1ba95add7e8ce41b7536b9
|
|
| MD5 |
de08d5bb272d694f66ef27c54c1f43ec
|
|
| BLAKE2b-256 |
90e407d6218e465a924d31416ed0a15e08c00e901811b6387fdaafb109bcf1d5
|