Lightweight dataflow tracer for Python functions
Project description
NeuroFlow ๐ง โจ
Ever wondered how your Python functions actually compute results? ๐ค
NeuroFlow transforms your mathematical functions into beautiful, interactive visual stories! Just add one decorator and watch your calculations come alive with stunning flowcharts that show exactly how your code thinks.
Perfect for: Students learning algorithms โข Developers debugging complex math โข Researchers explaining computations โข Anyone curious about how code works!
๐ฏ What Makes NeuroFlow Special?
Before NeuroFlow: Your function is a black box ๐ฆ
After NeuroFlow: Every step is crystal clear! ๐โจ
โจ Why You'll Love NeuroFlow
๐ฏ Zero Learning Curve - Add @trace and you're done!
๐จ Instagram-Worthy Graphs - Emojis, colors, and crystal-clear flow
โก Instant Insights - See exactly where your math goes wrong (or right!)
๐ฌ Debug Like a Pro - Trace complex algorithms step-by-step
๐ Perfect for Teaching - Students finally "get" how algorithms work
๐ Production Ready - Thread-safe, type-safe, and battle-tested
๐ Get Started in 30 Seconds
pip install neuroflow-viz
That's it! No complex setup, no heavy dependencies. Just pure Python magic! โจ
๐ฌ See It In Action (30-Second Demo)
from neuroflow import trace
@trace # โ This single line creates magic! โจ
def compound_interest(principal, rate, years):
return principal * (1 + rate)**years
# Run normally - but now you get BOTH result AND visual story!
result, graph = compound_interest(1000, 0.08, 3)
print(f"๐ฐ Your $1000 became: ${result:.2f}") # $1259.71
# See the beautiful visualization
graph.save_dot("my_calculation.dot")
# ๐ Paste this at: https://dreampuf.github.io/GraphvizOnline/
๐คฏ Mind = Blown! Your function now tells its own story!
๐จ Prepare to Be Amazed
These aren't your typical boring flowcharts. NeuroFlow creates visual masterpieces that make math beautiful:
"Finally, I can SEE what my code is thinking!" - Every Developer Ever
๐ฐ Compound Interest - Watch Your Money Grow!
Every step from $1000 โ $1259.71 visualized with emojis and colors
๐ Distance Formula - Geometry Made Visual
See Pythagorean theorem in action: 3ยฒ + 4ยฒ = 5ยฒ
๐ข Quadratic Formula - Algebra Comes Alive
Watch the discriminant calculation unfold step-by-step
๐ง Neural Network - AI Demystified
See how artificial neurons actually "think"
๐ฎ Interactive Demo - Try It Now!
Want to see the magic yourself? Run our demo and prepare to be amazed:
python demo.py # ๐ฌ 4 stunning visualizations in seconds!
You'll get:
- ๐ก "Aha!" moments as complex math becomes crystal clear
- ๐จ Beautiful graphs you'll want to frame on your wall
- ๐ง Deep understanding of how algorithms really work
- ๐ธ Screenshots to impress your colleagues
Warning: May cause sudden understanding of mathematics ๐
๐ ๏ธ Real-World Examples (Copy & Paste Ready)
๐ For Students - Finally Understand Math!
@trace
def quadratic_formula(a, b, c):
"""See the discriminant calculation step-by-step!"""
discriminant = b**2 - 4*a*c
sqrt_discriminant = discriminant**0.5
return (-b + sqrt_discriminant) / (2*a)
result, graph = quadratic_formula(1, -5, 6)
# ๐ฏ Now you can SEE why the answer is 3.0!
๐ผ For Finance Pros - Visualize Your Models
@trace
def compound_interest(principal, rate, years):
"""Show clients exactly how their money grows!"""
return principal * (1 + rate)**years
result, graph = compound_interest(1000, 0.08, 3)
# ๐ Perfect for client presentations!
๐ฎ For Game Developers - Debug Physics
@trace
def distance_formula(x1, y1, x2, y2):
"""Visualize collision detection calculations!"""
dx = x2 - x1
dy = y2 - y1
return (dx**2 + dy**2)**0.5
result, graph = distance_formula(0, 0, 3, 4)
# ๐ฏ See exactly how distance is calculated!
๐ผ๏ธ Turn Code Into Art
Two ways to see your beautiful graphs:
๐ Instant Online Viewing (Recommended)
- Copy your
.dotfile content - Paste at GraphvizOnline
- BAM! Instant beautiful visualization! โจ
๐ป Local Rendering (For Pros)
# Install Graphviz once
sudo apt-get install graphviz # Ubuntu/Debian
brew install graphviz # macOS
# Windows: Download from graphviz.org
# Create stunning images
dot -Tpng your_graph.dot -o your_graph.png
๐ Simple API (You'll Master in 5 Minutes)
๐ฏ The Magic Decorator
@trace # โ This is literally all you need!
def your_function(args):
return result
result, graph = your_function(inputs) # Get both result AND visualization!
๐ Graph Superpowers
# Quick text summary
print(graph.summary()) # See all operations at a glance
# Save beautiful visualization
graph.save_dot("my_graph.dot") # Ready for viewing!
# Advanced: Direct DOT access
dot_content = graph.to_dot() # Full control over output
๐จ Pro Visualization
from neuroflow import visualize_graph
# One-liner to create and save
visualize_graph(graph, "output.dot") # Done!
๐งฎ What Can NeuroFlow Trace?
Everything you need for mathematical computing:
โ
All Math Operations: + - * / // % **
โ
Advanced Functions: abs() -x (negation)
โ
Smart Comparisons: == < <= > >=
โ
Complex Data: Lists, tuples, dictionaries (nested too!)
โ
Real-World Code: Financial models, ML algorithms, physics simulations
If it's math, NeuroFlow can visualize it! ๐ฏ
๐ก๏ธ Built-in Safety Net
NeuroFlow catches errors before they catch you:
@trace
def risky_calculation(x):
return x / 0 # Uh oh!
try:
result, graph = risky_calculation(10)
except ZeroDivisionError as e:
print(f"NeuroFlow saved you: {e}") # Clear, helpful errors!
No more mysterious crashes! ๐ฏ
โก Production-Ready Features
๐ Thread-Safe: Use in multi-threaded apps without worry
๐ฏ Type-Safe: Full type hints for better IDE support
๐ Performance: Minimal overhead, maximum insight
๐งช Battle-Tested: Comprehensive test suite ensures reliability
๐ฏ Perfect For
โ
Mathematical Functions - See every calculation step
โ
Algorithm Learning - Understand how code works
โ
Debugging Complex Math - Find errors instantly
โ
Teaching & Presentations - Make code visual
โ
Research & Analysis - Document your computations
Note: Focuses on arithmetic operations (the heart of most algorithms!)
๐ค Join the NeuroFlow Community
Love NeuroFlow? Help make it even better!
- ๐ Found a bug? Open an issue
- ๐ก Have an idea? Start a discussion
- ๐ง Want to contribute? Submit a PR
- โญ Enjoying it? Star the repo!
Together, we're making code visualization accessible to everyone! ๐
๐ Ready to Transform Your Code?
pip install neuroflow-viz
In 30 seconds, you'll be creating beautiful visualizations that make complex math crystal clear!
Your future self (and your colleagues) will thank you. ๐
MIT License | Made with โค๏ธ by Nipun Sujesh
NeuroFlow v0.2.0 - Where Code Meets Art ๐จ
Project details
Release history Release notifications | RSS feed
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 neuroflow_viz-0.2.0.tar.gz.
File metadata
- Download URL: neuroflow_viz-0.2.0.tar.gz
- Upload date:
- Size: 13.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c24cfe0b264b3d8fc3955ac42d865d18f4c077863b275aaa370ae49a5b7e5c08
|
|
| MD5 |
cf6b4c979531acfbefbec0a5914dc61b
|
|
| BLAKE2b-256 |
0c028ff122a2c0490ab05321e4c0e7850398db10519c9d06e117e1e6212d47dd
|
File details
Details for the file neuroflow_viz-0.2.0-py3-none-any.whl.
File metadata
- Download URL: neuroflow_viz-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bac5201c9832240d60a370c2472043c94a78d5ddc3b131052b6c33fe147d5256
|
|
| MD5 |
d9b64d69bc0806475279ee4fb2e8fcf6
|
|
| BLAKE2b-256 |
8b4e19be5bf51e4f9107b03bf4767559138cea371966b9d9a3c616c66c02ff0e
|