Skip to main content

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-ignore file to exclude files and directories.
  • Optional integration with .gitignore to 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:

  1. Install the development dependencies:
pip install -e .[dev]
  1. 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

dirmapper-1.0.2.tar.gz (5.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dirmapper-1.0.2-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

dirmapper-1.0.2-py2-none-any.whl (5.9 kB view details)

Uploaded Python 2

File details

Details for the file dirmapper-1.0.2.tar.gz.

File metadata

  • Download URL: dirmapper-1.0.2.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for dirmapper-1.0.2.tar.gz
Algorithm Hash digest
SHA256 9535b02f1d3d7cc4408e8c4cc6d8cdad48dd8b9ea61db9236c70b9d0bdbeb6aa
MD5 0043fb53e3235b7d74bab602cc65c582
BLAKE2b-256 4744a6002fe1bd6897ef7fabae0733dc61b47a96be46cce914debc9d73456312

See more details on using hashes here.

File details

Details for the file dirmapper-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: dirmapper-1.0.2-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

Hashes for dirmapper-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ece9018aaef8a988cf019515be5bda4e2accc662f07df4918d918127be7b912
MD5 6cfa4bf946d7403b8bfa8e3c4ae74e9e
BLAKE2b-256 7c20d59aafef4120bac49c8f2cd1a83e3be680d33e34c621332ec9b0a3fe843b

See more details on using hashes here.

File details

Details for the file dirmapper-1.0.2-py2-none-any.whl.

File metadata

  • Download URL: dirmapper-1.0.2-py2-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for dirmapper-1.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 8606fcad51ed44b5d0e34177ee4af9528418117f92c9ef99a715f94ce109d87f
MD5 6550ce83e51cd4c2133f53a9b42bf7f5
BLAKE2b-256 64b5c5a24382c1d760893e556e1fc0175dd484692acab4a6f5b46fa2950fe646

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page