tlarsson commited on
Commit
e78a807
·
verified ·
1 Parent(s): 0a5d964

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -91
README.md CHANGED
@@ -1,94 +1,25 @@
1
  ---
2
- title: Code Graph
3
- emoji: 💻
4
- colorFrom: red
5
  colorTo: green
6
- sdk: docker
7
- pinned: false
8
- ---
9
-
10
-
11
-
12
-
13
- # 💻 Code Graph
14
-
15
- **Code Graph** is a visual tool that analyzes and displays function dependencies in Python code using AST-based static parsing.
16
-
17
- It’s ideal for developers, data scientists, and Streamlit users who want to understand how their functions interact — without needing to execute any code.
18
-
19
- ---
20
-
21
- ## 📌 What It Does
22
-
23
- Upload one or more `.py` files, and this tool will:
24
-
25
- - Parse the source code using Python’s built-in `ast` module
26
- - Identify function definitions and their relationships
27
- - Show which functions:
28
- - Are called from others
29
- - Read or write to `st.session_state`
30
- - Take specific arguments and return specific values
31
- - Display all this in a **fully interactive graph** and table
32
-
33
- ---
34
-
35
- ## 🧠 What is AST?
36
-
37
- AST stands for **Abstract Syntax Tree** — a structured representation of your source code as a tree. Each node represents a language construct like a function, loop, or assignment.
38
-
39
- Code Graph uses ASTs to analyze code structure **without running the code**, making it safe and fast to use.
40
-
41
- ---
42
-
43
- ## 🚀 Features
44
-
45
- ✅ Upload one or more Python files
46
- ✅ Auto-detect function calls and dependencies
47
- ✅ Highlights:
48
-
49
- - Function **arguments** and **return values** with inferred types (e.g. `df: pd.DataFrame`)
50
- - Streamlit `session_state` **reads/writes**
51
- - **Call order labels** on edges (`1`, `2`, `3`, …)
52
- - **Thicker edges** for functions called multiple times
53
-
54
- ✅ Export the graph as downloadable JSON
55
- ✅ View everything in an interactive graph and sortable table
56
-
57
- ---
58
-
59
- ## 📂 How to Use
60
-
61
- 1. Launch the app or clone this repo
62
- 2. Upload one or more `.py` files
63
- 3. Select the "main" or top-level function to explore
64
- 4. Interact with the graph and table to trace logic
65
-
66
- ---
67
-
68
- ## 🛠 Tech Stack
69
-
70
- - 🐍 Python
71
- - 📦 Dash & Plotly
72
- - 🧠 `ast` module (for static code parsing)
73
- - 🌐 Cytoscape.js (for interactive graph rendering)
74
-
75
- ---
76
-
77
- ## 🙋‍♂️ About the Author
78
-
79
- Created by **Tomas Larsson**, a data scientist and creator of
80
- [**my.moneytoolbox.com**](https://my.moneytoolbox.com) — a blog covering:
81
-
82
- - Tax-optimized investing
83
- - Retirement modeling
84
- - Financial tools for DIY investors
85
-
86
- ---
87
-
88
- ## 📤 Deployment (Docker-based)
89
-
90
- If you're running locally:
91
 
92
- ```bash
93
- docker build -t code-graph .
94
- docker run -p 7860:7860 code-graph
 
1
  ---
2
+ title: Function Call Visualizer (Python)
3
+ emoji: 🧠
4
+ colorFrom: indigo
5
  colorTo: green
6
+ sdk: gradio
7
+ app_file: app.py
8
+ tags:
9
+ - python
10
+ - static-analysis
11
+ - ast
12
+ - code-visualization
13
+ - dev-tools
14
+ - dash
15
+ - streamlit
16
+ - call-graph
17
+ pinned: true
18
+ license: mit
19
+ ---
20
+
21
+ Upload your Python files and see how your functions call each other—visually.
22
+ No execution needed. Great for refactoring, onboarding, auditing, and debugging.
23
+
24
+ Built by [Tomas Larsson](https://www.linkedin.com/in/tomaslarsson/) | [my.moneytoolbox.com](https://mymoneytoolbox.com)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25