A CLI tool to generate a directory structure mapping.
Project description
Dirmapper
Dirmapper is a CLI tool to generate a directory structure mapping. It provides a visual representation of the directory and file structure, similar to the tree command, with support for .gitignore-like patterns to exclude specific files and directories.
Features
- Generate a hierarchical view of a directory structure.
- Support for
.mapping-ignorefile to exclude files and directories. - Optional integration with
.gitignoreto exclude patterns specified in.gitignore.
Installation
Using pipx
It is recommended to use pipx to install dirmapper in an isolated environment:
pipx install dirmapper
Using pip
You can also install dirmapper using pip:
pip install dirmapper
Usage
Basic Usage
To generate a directory structure mapping:
dirmap /path/to/root_directory /path/to/output_file
Exclude Patterns with .mapping-ignore
Create a .mapping-ignore file in the root directory and specify the patterns you want to exclude:
.git/
*.tmp
*.log
Then run:
dirmap /path/to/root_directory /path/to/output_file --ignore_file /path/to/.mapping-ignore
Disable .gitignore Integration
By default, dirmap will also consider patterns in .gitignore. To disable this feature:
dirmap /path/to/root_directory /path/to/output_file --ignore_file /path/to/.mapping-ignore --no_gitignore
Example
Sample Directory Structure
project/
├── .git/
│ └── config
├── .github/
│ └── workflows/
│ └── ci.yml
├── src/
│ ├── main.py
│ ├── utils.py
└── README.md
Sample .mapping-ignore
.git/
.github/
Command
dirmap project output.txt --ignore_file project/.mapping-ignore
Sample Output
project/
├── src/
│ ├── main.py
│ └── utils.py
└── README.md
Development
Running Tests
Tests are written using pytest. To run the tests:
- Install the development dependencies:
pip install -e .[dev]
- Run the tests:
pytest
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Nash Dean
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 dirmapper-1.0.4.tar.gz.
File metadata
- Download URL: dirmapper-1.0.4.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18e04fd83e6bfce43fb7eb92d20ac7e7e7344c4ce1f72f65e33fa882d00f930a
|
|
| MD5 |
fe498e487341ccce1bff55c0f0810e85
|
|
| BLAKE2b-256 |
31bf4699f29899d0d4a9415f82c269c6a7213fe18c3a470f5dfb1a15c5679f18
|
File details
Details for the file dirmapper-1.0.4-py3-none-any.whl.
File metadata
- Download URL: dirmapper-1.0.4-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
660e6ba91d2e88d0d5903897d57474d0df043c497fbe4313cb155aa254c121d2
|
|
| MD5 |
5b6d234a04228d3cdaa111673fd79547
|
|
| BLAKE2b-256 |
cdd1720efae8e90fecfd12c43647971267dd72959a45da3d16cfe763f173d503
|