Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.rst

CodeGraph - static code analyzator, that create a diagram with your code structure.

badge1 badge2 badge3 workflow codecov

Live Demo - Interactive visualization of simple-ddl-parser codebase

Tool that creates a diagram with your code structure to show dependencies between code entities (methods, modules, classes and etc). Main advantage of CodeGraph is that it does not execute the code itself. You don't need to activate any environments or install dependencies to analyze the target code. It is based only on lexical and syntax parsing, so it doesn't need to install all your code dependencies.

Interactive Visualization

Interactive Code Visualization

Zoom, Pan & Drag - Use mouse wheel to zoom, drag background to pan, drag nodes to reposition them.

Search & Highlight

Node Search

Search with Autocomplete - Press Ctrl+F (or Cmd+F on Mac) to search. Results show node type with color coding.

Highlight Nodes

Highlight Connections - Click on any node to highlight it and all connected nodes. Others will be dimmed.

Node Information

Node Information

Tooltips - Hover over any node to see details: type, parent module, full path, and connection count.

Unlinked Modules

Unlinked Nodes

Unlinked Panel - Shows modules with no connections. Click to navigate to them on the graph.

Massive Objects Detection

Massive Objects Detection

Massive Objects Panel - Find large code entities (modules, classes, functions) by lines of code. Filter by type and set custom threshold.

Display Settings

Display Settings

Size by Lines of Code - Toggle node size scaling based on lines of code. Larger nodes = more code.

UI Tips

UI Tips

Built-in Help - Legend and keyboard shortcuts are always visible in the UI.

Draggable Panels - All UI panels can be dragged and collapsed for a cleaner view.


Installation

pip install codegraph

For legacy matplotlib visualization support:

pip install codegraph[matplotlib]

Usage

codegraph /path/to/your_python_code

This will generate an interactive HTML visualization and open it in your browser.

CLI Options

Option Description
--output PATH Custom output path for HTML file (default: ./codegraph.html)
--matplotlib Use legacy matplotlib visualization instead of D3.js (requires codegraph[matplotlib])
-o, --object-only Print dependencies to console only, no visualization

Changelog

See CHANGELOG.md for full version history.