A CLI utility to print the directory tree structure with customizable exclusions.
Project description
PrintDirTree
printdirtree
is a command-line utility that prints the structure of a directory tree,
allowing you to easily specify files and directories to exclude.
Example:
$ printdirtree
PrintDirTree
├── MANIFEST.in
├── README.md
├── printdirtree
│ ├── __init__.py
│ └── __main__.py
└── setup.py
This tool is very useful to aid with prompting ChatGPT.
Installation
Install printdirtree
easily with pip:
pip install printdirtree
Usage
To use printdirtree
, simply run the command followed by optional arguments to tailor the output to your needs.
The basic usage prints the current directory structure:
printdirtree
Specifying a Directory
To print the structure of a specific directory:
printdirtree --dir /path/to/directory
Excluding Directories and Files
Exclude specific directories and/or file patterns:
printdirtree --exclude-dir node_modules --exclude-dir .git --exclude-file "*.log"
Saving Preferences
To save your exclusions for future runs:
printdirtree --exclude-dir temp --exclude-file "*.tmp" --save
Viewing Current Exclusions
See what exclusions are currently saved:
printdirtree --view-exclusions
Including Directories and Files Back
To remove exclusions and include directories or files back into the printout:
printdirtree --include-dir temp --include-file "*.tmp" --save
Example Usage
After installing printdirtree
, you can run it to visualize the structure of your project directory. Here's an example command that excludes .git
files:
printdirtree --exclude-file ".git"
Output for the PrintDirTree
project might look like this:
PrintDirTree
├── MANIFEST.in
├── README.md
├── printdirtree
│ ├── __init__.py
│ └── __main__.py
└── setup.py
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
File details
Details for the file printdirtree-0.1.4.tar.gz
.
File metadata
- Download URL: printdirtree-0.1.4.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82d0305eb7a640c3e500d7bc9866668eb70518ce5bc5f9dbbb36fb9dec69f00f |
|
MD5 | ae42baf4b86cb20b17c334f862e99a96 |
|
BLAKE2b-256 | f668cc0cb39e0b99f46f6aa0a261009d097bcfd4485a9204503eb9941fa0d2ef |
File details
Details for the file printdirtree-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: printdirtree-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e44dfa047c88d9ee52c4e1006d32f7fc6b45a9a41816e92120787e21f1efcf80 |
|
MD5 | 8f5750aef99f65c7b585437126d04896 |
|
BLAKE2b-256 | 20494269262d17aaa6d57989454b7853ae0aadf8bbd3c8c4c2c0dfbecabed72e |