A tool to analyze and visualize C++ project dependencies
Project description
GraphSpire
A tool to analyze and visualize C++ project dependencies. It generates beautiful dependency graphs from your C++ project's include statements.
Why GraphSpire?
Ever found yourself lost in a maze of C++ includes? GraphSpire helps you navigate through complex C++ projects by generating clear, beautiful dependency graphs. Whether you're refactoring legacy code or starting a new project, GraphSpire gives you the bird's-eye view you need.
Features
- Analyzes C++ project structure and include dependencies
- Generates multiple visualization formats:
- JSON structure for programmatic use
- Mermaid graph for documentation
- Graphviz DOT for high-quality visualizations
- Respects
.gitignorepatterns - Customizable ignore patterns
- Beautiful Catppuccin-themed visualizations
Quick Start
# Install from PyPI
pip install graphspire
# Or install from source
git clone https://github.com/kshitijaucharmal/graphspire.git
cd graphspire
pip install -e .
Usage
Basic usage:
graphspire --dir /path/to/cpp/project
Advanced usage:
graphspire \
--dir /path/to/cpp/project \
--ignore "build/" "external/" \
--output-json deps.json \
--output-mermaid deps.mmd \
--output-dot deps.dot \
--verbose
Command Line Options
--dir: Target directory to analyze (default: current directory)--output-json: Output JSON file (default: project_structure.json)--output-mermaid: Output Mermaid file (default: dependencies.mmd)--output-dot: Output DOT file (default: dependencies.dot)--ignore-gitignore: Ignore .gitignore file--ignore: Explicit folders or files to ignore (supports patterns)--verbose: Enable verbose output
Rendering the DOT File
To render the DOT file into a PNG:
dot -Tpng -Gdpi=300 -Gsize=10,10 dependencies.dot -o graph.png
Development
Want to contribute? Awesome! Here's how to get started:
- Clone the repository
- Create a virtual environment:
python -m venv .venv source .venv/bin/activate # or `.venv\Scripts\activate` on Windows
- Install development dependencies:
pip install -e ".[dev]"
- Run tests:
pytest
License
MIT License - feel free to use this in your projects!
Contributing
Found a bug? Have a feature request? Contributions are welcome! Feel free to open an issue or submit a pull request.
Built for the C++ community
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graphspire-0.1.3.tar.gz.
File metadata
- Download URL: graphspire-0.1.3.tar.gz
- Upload date:
- Size: 3.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f76b06bac596b861193ffe0218a71669e15c8980f1550330649dff50afaa5861
|
|
| MD5 |
3c615504cc65f170efba17050d80dfcd
|
|
| BLAKE2b-256 |
b111325d6914c4ea0c0baaf9e96c00bbc71b15543da9f4f4dc0d93e214836a8d
|
File details
Details for the file graphspire-0.1.3-py3-none-any.whl.
File metadata
- Download URL: graphspire-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4160823de4f97698a3b1611b3a7c8ed9dfa91df9c71c1392097fad4bd640818f
|
|
| MD5 |
8c60203fa921fa0dda33f1b151e17863
|
|
| BLAKE2b-256 |
17c47a87e857ada16bbe9d43495367889ba410d274eedf855f3ab5b7bc59ddeb
|