Pydescope

🐍 Pydescope: Python Project Dependency Visualiser

Pydescope Dependency Graph

Last Commit Repo Size License

Python NetworkX PyVis Click

Pydescope is a static analysis tool designed to help developers visualize the internal structure and dependencies of their Python projects. By parsing source code and mapping imports, it generates interactive 2D/3D graphs using NetworkX and PyVis, allowing you to see how different modules interact without the clutter of virtual environments or external libraries.


📸 Screenshots


🧠 Key Features


🏗️ Project Architecture

pydescope/
├── .gitignore               # Standard git ignore rules
├── pyproject.toml           # Build system and dependency configuration
├── README.md                # Project documentation
├── CONTRIBUTING.md          # Contributing documentation
├── LICENSE.md               # License documentation
├── pydescope/               # Core logic package
│   ├── __init__.py          # Package initialization
│   ├── analyzer.py          # Logic for parsing imports and code analysis
│   ├── graph_builder.py     # NetworkX graph construction
|   ├── parser.py            # Identifes .py files in projects
│   ├── renderer.py          # PyVis conversion and HTML generation
│   └── utils.py             # Internal helper functions
|   └── cli.py               # User interaction tool
└── lib/                     # Static assets for the final output
    └── bindings/
        └── utils.js         # Custom JS for highlighting and interactivity

🛠️ Installation

Clone your repository (or navigate to the project folder):

cd pydescope

Install in editable mode:

This installs the dependencies and allows you to run the pydescope command directly.

pip install -e .

How to Run

Once installed, you can run Pydescope from your terminal.

Basic Usage

Point Pydescope at any Python project directory you want to analyze:

pydescope <path_to_target_project>
Command Options
Output Name: Specify a custom name for your HTML report.
pydescope <path_to_project> --output my_graph.html
Exclude Directories: Although it ignores venv by default, you can add more exclusions.
pydescope <path_to_project> --exclude tests,docs
Visualisation Controls
The generated HTML file includes advanced JavaScript-based controls located in the lib/bindings/utils.js file:

💻 Tech Stack


📝 Notes for Developers