A tool to index a repository and generate structured outputs for visualization and documentation.
Project description
repindex
repindex is a Python tool that indexes a repository and generates structured outputs for visualization and documentation.
Features
- Repository Structure: Generates a tree-like representation of the repository.
- Dependency Graphs:
- Full Graph: Includes both imports and exports with objects listed.
- Imports Only Graph: Only considers imports for listing objects.
- Exports Only Graph: Only considers exports for listing objects.
- No Objects Graph: Includes all relationships but does not list objects.
- Markdown Documentation:
- Full Documentation: Compiles all files and their contents into a structured Markdown document.
- Light Documentation: Includes only code files (
.ts,.tsx,.css,.py,.sh, etc.) and excludes files like.json,.html,.txt, etc.
Installation
Install repindex using pip:
pip install repindex
Usage
repindex /path/to/repository [-o /path/to/output_dir]
- repository_path: The path to the repository you want to index.
- -o, --output_dir: (Optional) The directory where outputs will be saved. Defaults to the current directory.
Example:
repindex ./my_project -o ./output
Outputs
The outputs are saved in a repindex/ directory inside the specified output directory:
- tree_structure.txt: Tree representation of the repository.
- Dependency Graphs:
dependency_graph_full.json: Full graph with imports and exports, including objects.dependency_graph_imports.json: Only imports with objects listed.dependency_graph_exports.json: Only exports with objects listed.dependency_graph_no_objects.json: All relationships without listing objects.
- Markdown Documentation:
documentation.md: Full documentation with all files and contents.documentation_light.md: Light documentation including only code files.
Running Tests
To run the unit tests:
python -m unittest discover tests
Code Style
The code adheres to PEP8 standards. You can check code style using flake8:
pip install flake8
flake8 repindex tests
Continuous Integration
Continuous Integration is set up using GitHub Actions. The workflow runs tests and linting on each push and pull request.
License
This project is licensed under the MIT License.
Author
- Name: Simon Yang
- GitHub: yangsi7
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
Acknowledgments
- Thanks to Me, Myself and I, who have helped improve this project.
Publishing to PyPI
To publish a new version of repindex to PyPI:
-
Update the Version Number:
Update the__version__in yourrepindex/__init__.pyor wherever the version is defined. -
Install Build Tools:
pip install build twine
-
Create a Distribution:
python3 -m build
This command will generate source and wheel distributions in the
dist/directory. -
Upload to PyPI: Make sure you have a valid PyPI account and have configured your
.pypircfile if needed. Then:twine upload dist/*
You will be prompted for your PyPI username and password (or token).
-
Verify Installation: After a successful upload:
pip install --upgrade repindex
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 repindex-0.3.0.tar.gz.
File metadata
- Download URL: repindex-0.3.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa76509e9029677f9890908ca1431c896194a2024e068d492f7f3c5195072f28
|
|
| MD5 |
cfbb1b6b2f4f21735be1e57a34ff6df4
|
|
| BLAKE2b-256 |
43ce52266170ac9a8fef21c10b7fd1370deacf2365cd7aa27504e4f336183879
|
File details
Details for the file repindex-0.3.0-py3-none-any.whl.
File metadata
- Download URL: repindex-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d89ba0fa36a5e3bb394077db73db32956b93f3e51f657f64799237ecd8f8003
|
|
| MD5 |
f9cd243290214d7e81b496f842996445
|
|
| BLAKE2b-256 |
d1274a59ba94a9f9eb90201a35c2bdc7cc880d8b4117bd5cae0ad76e5fe222eb
|