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.
- 🔍 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
pip install code2flow-visualizer
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)
from code2flow import FlowVisualizer
visualizer = FlowVisualizer()
visualizer.track_function(your_function)
visualizer.display() # Shows interactive widget
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")
pip install code2flow-visualizer
pip install code2flow-visualizer[dev]
pip install code2flow-visualizer[mermaid]
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
┌─────────────────┐
│ fibonacci(5) │
│ n = 5 │
└─────┬───────────┘
│
▼
┌─────────────────┐
│ n > 1 ? │
│ True │
└─────┬───────────┘
│
▼
┌─────────────────┐
│ fibonacci(4) + │
│ fibonacci(3) │
└─────────────────┘
MIT License - see LICENSE file for details.
Made with ❤️ for the Python community