Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

printdirtree

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

printdirtree

A CLI utility to print the directory tree structure with customizable exclusions.

  • 0.1.4
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc