A CLI tool to visualize directory structures as Markdown or Mermaid diagrams
Project description
Directory Visualizer
A simple CLI tool to visualize directory structures as Markdown or Mermaid diagrams. This tool can help you quickly document the folder structure of any directory in a human-readable format or generate a Mermaid diagram for visual representation.
Features
- Directory Structure Visualization: Create an easily readable Markdown file that represents the directory structure.
- Mermaid Diagram Generation: Generate a Mermaid diagram to visualize the directory structure as a flowchart.
- CLI Tool: Run the tool from the command line with various options for customization, such as setting the depth of traversal or choosing the output format.
Installation
To install directory-visualizer, you can use pip:
pip install directory-visualizer
Usage
Once installed, you can use the command line interface (CLI) to visualize any directory.
Basic Command
To generate a directory structure in Markdown format:
directory-visualizer -p <path_to_directory> -f markdown
This will create a directory_structure.md file in the current working directory.
Generate Mermaid Diagram
To generate a Mermaid diagram (embedded in Markdown):
directory-visualizer -p <path_to_directory> -f mermaid
This will create a directory_structure.md file with the Mermaid diagram.
Generate Raw Mermaid File
If you prefer to save the diagram as a raw .mmd file, use the --raw-mermaid flag:
directory-visualizer -p <path_to_directory> -f mermaid --raw-mermaid
This will create a directory_structure.mmd file that can be rendered using Mermaid live editors or other Mermaid-supported tools.
Set Directory Traversal Depth
You can limit the depth of directory traversal using the --depth option. For example, to visualize only the first two levels of a directory structure:
directory-visualizer -p <path_to_directory> -f markdown --depth 2
Output to Specific File
Use the -o option to specify a custom output file name:
directory-visualizer -p <path_to_directory> -f markdown -o custom_output.md
Example
To visualize the directory structure of E:\files\Directory_Visualizer\directory-visualizer in Markdown format with a depth of 3:
directory-visualizer -p E:\files\Directory_Visualizer\directory-visualizer -f markdown --depth 3
This will generate a directory_structure.md file with the directory structure up to level 3.
Options
-p, --path <directory>: Path to the directory to visualize.-f, --format <format>: Output format (markdown,mermaid). Default ismarkdown.-o, --output <file>: Output file path to save the visualization.--depth <depth>: Limit the directory traversal depth.--raw-mermaid: Save the Mermaid diagram as a raw.mmdfile (instead of Markdown).
Example Output
Markdown Example
# Directory Structure of E:\files\Directory_Visualizer\directory-visualizer
- # directory-visualizer
- LICENSE
- MANIFEST.in
- README.md
- setup.py
- ## tests
- test_visualizer.py
- __init__.py
- ## visualizer
- custom_output.md
- directory_structure.md
- visualizer.py
- __init__.py
Mermaid Example
graph TD
directory-visualizer[(directory-visualizer)]
directory-visualizer --> LICENSE
directory-visualizer --> MANIFEST.in
directory-visualizer --> README.md
directory-visualizer --> setup.py
directory-visualizer --> tests[(tests)]
tests --> test_visualizer.py
tests --> __init__.py
directory-visualizer --> visualizer[(visualizer)]
visualizer --> custom_output.md
visualizer --> directory_structure.md
visualizer --> visualizer.py
visualizer --> __init__.py
Contributing
If you would like to contribute to this project, please fork the repository, create a new branch, and submit a pull request. All contributions are welcome!
Steps to Contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name. - Make your changes.
- Commit your changes:
git commit -am 'Add new feature'. - Push to your forked branch:
git push origin feature-name. - Open a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Md. Rasel Meya
- Email: rhrasel94@gmail.com
- GitHub: raselmeya94
Acknowledgements
- Thanks to all the contributors who helped improve this project.
- Special thanks to the open-source community for their valuable contributions.
Points to Note:
- Features section: Briefly explains what your tool does.
- Installation and Usage: Guides the user on how to install and use the tool with examples of common commands.
- Example Output: Shows what the output looks like for both markdown and mermaid formats.
- Contributing: Instructions for contributing to the project.
- License: Specifies the project's licensing (MIT, in this case).
- Acknowledgements: Recognizes contributors and open-source support.
This README file should provide users with all the necessary information to get started with your directory-visualizer project. You can always modify the details as you see fit. Let me know if you'd like any adjustments!
Project details
Release history Release notifications | RSS feed
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 directory_visualizer-0.1.0.tar.gz.
File metadata
- Download URL: directory_visualizer-0.1.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d091e517684c6d62e9aab8019232fba80578e2c48aebb807959a676b05ac6e1
|
|
| MD5 |
c4ada5db4e45decafb876103249986cf
|
|
| BLAKE2b-256 |
6614a7e38cac4d9532e676a259ed5f591e1d2f5bfc5ce6fdee683e18d35d430c
|
File details
Details for the file directory_visualizer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: directory_visualizer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79501eac6522798e48e3524430c70b1962adff91bcd9a12a17c5ae225d1730cb
|
|
| MD5 |
9f50ceaa53498c3eb0d270de9ee1a8f0
|
|
| BLAKE2b-256 |
98c3c096370397e4a4388a90f31b5bc4e372986c0e17fb8cbfe3c0e92bc39cbf
|