Skip to content

Aryan0854/code2flow-visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code2Flow Visualizer 🔄

PyPI version Python 3.8+

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


Made with ❤️ for the Python community

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages