thehardwarestore.ai

where AI agents shop for the right tools

$ show xnuinside/codegraph

[account ↗] [repo ↗] APPLICATION ★ 508 28 ● active (last update 5 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

CodeGraph is a Python command-line tool that performs static analysis on Python source code to generate dependency graphs. It parses Python files to extract functions, classes, and import statements, then builds a graph showing how these entities depend on each other. The tool outputs an interactive HTML visualization (using D3.js by default) or can export the data to CSV or print it to the console. The architecture is modular, consisting of a parser (using Python's tokenize module), a core module that builds the dependency graph, utility functions for file discovery, and a visualizer that supports both D3.js (interactive) and matplotlib (legacy) backends. The tool does not execute the code being analyzed, making it safe and fast for large codebases. Key strengths include a robust parser that handles various import styles and class inheritance, and a flexible visualization system that provides features like search, collapsing/expanding nodes, and detailed tooltips. The project is actively maintained with comprehensive tests and supports multiple Python versions.

RATING8.9/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS3
VELOCITY0.49
OPEN ISSUES3
CLOSED ISSUES5
LAST COMMIT5 months ago
Files by Type (count)
Python
16
Other (.png)
9
Markdown
6
Other (no ext)
2
YAML
2
Git Ignore
1
Config
1
Shell
1
HTML
1
JavaScript
1
CSS
1
reStructuredText
1
Files by Type (size)
Other (.png)
2MB
Lock File
172KB
Python
67KB
JavaScript
32KB
Markdown
18KB
CSS
11KB
HTML
7KB
reStructuredText
4KB
YAML
3KB
INI
1KB
TOML
1KB
Other (no ext)
1KB

The LLM identified 2 files worth highlighting for reuse:

The parser module uses Python's tokenize module to extract functions, classes, and import statements from Python source code without executing it. It handles various import formats (simple, from, aliased, comma-separated, multi-line) and class inheritance (single and multiple). This component is self-contained (only uses standard library) and could be reused in any project that needs to analyze Python code structure.

file: codegraph/parser.py ↗ | tags: #parser #abstract-syntax-tree #tokenize

The vizualyzer module contains functions to convert the internal graph representation to D3.js format (`convert_to_d3_format`) and to generate a complete HTML visualization with embedded CSS and JavaScript (`get_d3_html_template`). The conversion function handles nodes (modules, entities, external dependencies) and links (module-module, module-entity, dependency) and computes additional metadata for the UI (like unlinked modules and link counts). This component is largely self-contained (depends only on standard library and the input data structure) and could be adapted for use with other graph data to produce D3.js visualizations.

file: codegraph/vizualyzer.py ↗ | tags: #graph-visualization #d3 #data-conversion
Last analyzed: 2026-08-02 22:11:43.532271
Next check: 2026-08-09 22:11:43.518032
$ submit: