Skip to content

MaybeBio/Repo-Inspector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Repo-Inspector

MIT License PR's Welcome

๐Ÿ•ต๏ธ Repo-Inspector helps developers and reviewers quickly understand a Python repository. It produces a concise static analysis report and โ€” optionally โ€” deeper runtime inspection output by integrating with LibInspector.

Key outcomes:

  • A static Markdown report summarizing modules, APIs, and structure.
  • Per-file AST summaries for quick browsing.
  • Optional dynamic inspection (LibInspector) with per-target reports and a merged, deduplicated dynamic report (Markdown + optional HTML).

Quick install

# Clone the repository
git clone https://github.com/MaybeBio/Repo-Inspector.git
cd Repo-Inspector

# Install in editable mode (installs dependencies & CLI tool)
pip install -e .

Help manual

โฏ repo-inspector --help
                                                                                                                                                                
 Usage: repo-inspector [OPTIONS] PATH                                                                                                                           
                                                                                                                                                                
 Analyze a local Python project folder statically, with optional dynamic analysis bridge.                                                                       
                                                                                                                                                                
โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    path      TEXT  Path to the local folder (or git cloned repo) [required]                                                                                โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --output              -o      TEXT  Output Markdown file path [default: report.md]                                                                           โ”‚
โ”‚ --dynamic             -d            Enable dynamic analysis using LibInspector (requires installation).                                                      โ”‚
โ”‚ --install-completion                Install completion for the current shell.                                                                                โ”‚
โ”‚ --show-completion                   Show completion for the current shell, to copy it or customize the installation.                                         โ”‚
โ”‚ --help                              Show this message and exit.                                                                                              โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

We recommend writing outputs into a dedicated directory, for example /path/PROJECT_REPORT_DIR/. Pass the desired Markdown file path with -o; e.g. -o /path/PROJECT_REPORT_DIR/project_report.md. Repo-Inspector will create the output directory if it does not exist and will place generated artifacts under a reports/ subfolder next to your output (you will find the main Markdown report and a reports/ folder containing AST summaries and any dynamic outputs).

Quick usage

Generate a static report:

repo-inspector /path/to/repo -o ./reports/project_report.md

Run dynamic inspection (requires LibInspector):

repo-inspector /path/to/repo -o ./reports/project_report.md -d

What you get (when -d is used):

  • reports/INDEX.md โ€” repository index and AST summaries
  • reports/dynamic/ โ€” per-target LibInspector reports (Markdown + HTML)
  • reports/dynamic/<base>_merged_dynamic.md โ€” merged & deduplicated dynamic report
  • When LibInspector is importable, HTML renderings are produced alongside the Markdown files

LibInspector (optional)

Dynamic analysis depends on LibInspector. Install it when you want runtime inspection:

pip install git+https://github.com/MaybeBio/LibInspector.git

or check my page for detailed installation guidance: LibInspector

If LibInspector is not installed, Repo-Inspector will still produce the static report and AST summaries.

Output & Links

The tool produces three primary artifacts: the top-level Markdown report (e.g. ./reports/project_report.md); the INDEX.md inside a same-named folder (e.g. ./reports/project_report/INDEX.md) containing the repo index and AST summaries; and the merged dynamic report inside that folderโ€™s dynamic/ subfolder (e.g. ./reports/project_report/dynamic/project_report_merged_dynamic.md). The top-level report includes relative links to these files and their HTML renditions when available for quick review.

Recommended workflow

  1. Run the static scan to get a quick overview.
  2. Set "-d" parameter to run dynamic inspection for package entry-points, CLI scripts, examples or tests (these are auto-detected by Repo-Inspector). For optimal results, we strongly recommend installing LibInspector in advance and installing the target package directly from the repository you intend to inspect.
  3. Review the inspection markdown output with a focus on the three primary artifacts highlighted above (see Output & Links section). Alternatively, use the generated HTML report for a more intuitive, interactive viewing experience.

Test Case

โฏ repo-inspector ../TensorVis/  -d -o ./test/Tensorvis.md

๐Ÿ” [Static] Scanning directory: ../TensorVis/ ...
๐Ÿ“Š [Static] Found 5 modules.
โœ… Report saved to: ./test/Tensorvis.md

๐Ÿš€ [Dynamic] Initiating LibInspector Bridge...
๐Ÿ” [Dynamic] Building repo index and AST summaries...
๐Ÿ” [Dynamic] Detecting runtime targets (entry points, scripts, CLIs)...
โ–ถ [Dynamic] Running LibInspector on tensorvis (hint=module) -> test/Tensorvis/dynamic/Tensorvis_dynamic_1_module_tensorvis.md
๐Ÿ” Target Resolution: Input='tensorvis' -> Import='tensorvis' (Type: module)

๐Ÿ” Running candidate 1/1: tensorvis -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_1_module_tensorvis_candidate_1_tensorvis.md
๐Ÿ” Target Resolution: Input='tensorvis' -> Import='tensorvis' (Type: module)
โŒ Error: Unable to import any candidate modules for target 'tensorvis'.
โ–ถ [Dynamic] Running LibInspector on ../TensorVis/TensorVis/vis.py (hint=file) -> test/Tensorvis/dynamic/Tensorvis_dynamic_2_file_.._TensorVis_TensorVis_vis.py.md
๐Ÿ” Target Resolution: Input='../TensorVis/TensorVis/vis.py' -> Import='vis' (Type: file)

๐Ÿ” Running candidate 1/3: TensorVis.vis -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_2_file_.._TensorVis_TensorVis_vis.py_candidate_1_TensorVis.vis.md
๐Ÿ” Target Resolution: Input='TensorVis.vis' -> Import='TensorVis.vis' (Type: module)
โŒ Error: Unable to import any candidate modules for target 'TensorVis.vis'.

๐Ÿ” Running candidate 2/3: vis -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_2_file_.._TensorVis_TensorVis_vis.py_candidate_2_vis.md
๐Ÿ” Target Resolution: Input='vis' -> Import='vis' (Type: module)
โŒ Error: Unable to import any candidate modules for target 'vis'.

๐Ÿ” Running candidate 3/3: /data2/TensorVis/TensorVis/vis.py -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_2_file_.._TensorVis_TensorVis_vis.py_candidate_3_vis.py.md
๐Ÿ” Target Resolution: Input='/data2/TensorVis/TensorVis/vis.py' -> Import='vis' (Type: file)
๐Ÿ” Analyzing dependencies for 'TensorVis.vis' (Network Analysis Phase)...
โœ… Markdown report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_2_file_.._TensorVis_TensorVis_vis.py_candidate_3_vis.py.md
๐Ÿ“Š Interactive HTML report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_2_file_.._TensorVis_TensorVis_vis.py_candidate_3_vis.py.html
   (Open the HTML file in your browser to see rendered charts)
โ–ถ [Dynamic] Running LibInspector on ../TensorVis/TensorVis/cli.py (hint=file) -> test/Tensorvis/dynamic/Tensorvis_dynamic_3_file_.._TensorVis_TensorVis_cli.py.md
๐Ÿ” Target Resolution: Input='../TensorVis/TensorVis/cli.py' -> Import='cli' (Type: file)

๐Ÿ” Running candidate 1/3: TensorVis.cli -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_3_file_.._TensorVis_TensorVis_cli.py_candidate_1_TensorVis.cli.md
๐Ÿ” Target Resolution: Input='TensorVis.cli' -> Import='TensorVis.cli' (Type: module)
๐Ÿ” Analyzing dependencies for 'TensorVis.cli' (Network Analysis Phase)...
โœ… Markdown report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_3_file_.._TensorVis_TensorVis_cli.py_candidate_1_TensorVis.cli.md
๐Ÿ“Š Interactive HTML report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_3_file_.._TensorVis_TensorVis_cli.py_candidate_1_TensorVis.cli.html
   (Open the HTML file in your browser to see rendered charts)

๐Ÿ” Running candidate 2/3: cli -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_3_file_.._TensorVis_TensorVis_cli.py_candidate_2_cli.md
๐Ÿ” Target Resolution: Input='cli' -> Import='cli' (Type: module)
โŒ Error: Unable to import any candidate modules for target 'cli'.

๐Ÿ” Running candidate 3/3: /data2/TensorVis/TensorVis/cli.py -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_3_file_.._TensorVis_TensorVis_cli.py_candidate_3_cli.py.md
๐Ÿ” Target Resolution: Input='/data2/TensorVis/TensorVis/cli.py' -> Import='cli' (Type: file)
๐Ÿ” Analyzing dependencies for 'TensorVis.cli' (Network Analysis Phase)...
โœ… Markdown report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_3_file_.._TensorVis_TensorVis_cli.py_candidate_3_cli.py.md
๐Ÿ“Š Interactive HTML report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_3_file_.._TensorVis_TensorVis_cli.py_candidate_3_cli.py.html
   (Open the HTML file in your browser to see rendered charts)
โ–ถ [Dynamic] Running LibInspector on ../TensorVis/TensorVis/op_viz.py (hint=file) -> test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py.md
๐Ÿ” Target Resolution: Input='../TensorVis/TensorVis/op_viz.py' -> Import='op_viz' (Type: file)

๐Ÿ” Running candidate 1/3: TensorVis.op_viz -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py_candidate_1_TensorVis.op_viz.md
๐Ÿ” Target Resolution: Input='TensorVis.op_viz' -> Import='TensorVis.op_viz' (Type: module)
๐Ÿ” Analyzing dependencies for 'TensorVis.op_viz' (Network Analysis Phase)...
โœ… Markdown report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py_candidate_1_TensorVis.op_viz.md
๐Ÿ“Š Interactive HTML report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py_candidate_1_TensorVis.op_viz.html
   (Open the HTML file in your browser to see rendered charts)

๐Ÿ” Running candidate 2/3: op_viz -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py_candidate_2_op_viz.md
๐Ÿ” Target Resolution: Input='op_viz' -> Import='op_viz' (Type: module)
๐Ÿ” Analyzing dependencies for 'op_viz' (Network Analysis Phase)...
โœ… Markdown report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py_candidate_2_op_viz.md
๐Ÿ“Š Interactive HTML report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py_candidate_2_op_viz.html
   (Open the HTML file in your browser to see rendered charts)

๐Ÿ” Running candidate 3/3: /data2/TensorVis/TensorVis/op_viz.py -> output=./test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py_candidate_3_op_viz.py.md
๐Ÿ” Target Resolution: Input='/data2/TensorVis/TensorVis/op_viz.py' -> Import='op_viz' (Type: file)
๐Ÿ” Analyzing dependencies for 'TensorVis.op_viz' (Network Analysis Phase)...
โœ… Markdown report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py_candidate_3_op_viz.py.md
๐Ÿ“Š Interactive HTML report saved to: /data2/Repo-Inspector/test/Tensorvis/dynamic/Tensorvis_dynamic_4_file_.._TensorVis_TensorVis_op_viz.py_candidate_3_op_viz.py.html
   (Open the HTML file in your browser to see rendered charts)
๐Ÿ” [Dynamic] Merging and deduplicating dynamic reports...
โœ… Merged dynamic reports -> test/Tensorvis/dynamic/Tensorvis_merged_dynamic.md (6 files included)
โœ… Rendered HTML index -> test/Tensorvis/INDEX.html
โœ… Rendered merged dynamic HTML -> test/Tensorvis/dynamic/Tensorvis_merged_dynamic.html
โœ… Rendered main static HTML -> test/Tensorvis.html

you can check the result in Test case for Tensorvis repo

References

ToDos

  • For LLM support, DeepWiKi is also a good choice

About

Repo-Inspector helps developers and reviewers quickly understand a Python repository

Resources

Stars

Watchers

Forks

Packages

No packages published