You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

tree-viewer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-viewer

Tree-Viewer is a Python tool for generating customizable visual representations of directory trees, ideal for developers who need to manage and navigate complex project structures. It offers a clear, structured view of directory contents, enhancing project organization and accessibility.

0.1.1
pipPyPI
Maintainers
1

Tree Viewer

Overview

This project provides a customizable tree of your current directory or project. The tool allows you to get a complete structure of your project with options to include hidden directories and exclude specific files or directories.

Installation

pip install tree-viewer

then run:

tree-viewer

you will see your current directory tree in the console.

Saving Directory Tree

If you want to save the results of your current directory tree, run:

tree-viewer --output file_name.txt

It will generate the results in the current directory file_name.txt.

Include Hidden Directories

The tree-viewer tool now supports including hidden directories in the directory tree structure. Hidden directories are those whose names begin with a dot (., such as .git or .config). By default, hidden directories are excluded from the tree structure.

To include hidden directories in the tree structure, use the --hidden flag:

tree-viewer --hidden

Exclude Specific Directories and Files

The tree-viewer tool also allows you to exclude specific directories or files from the directory tree. This can be useful for omitting directories like node_modules or files such as config.json that you do not want to appear in the output.

To exclude specific directories or files, use the --excludes option followed by the names of the directories or files:

tree-viewer --excludes .git node_modules config.json

Common Issues and Solutions

  • Installation Path: Ensure that the Python packages installation path is included in your system's PATH environment variable.
  • Shell Restart: You might need to restart your shell (like Bash) to recognize changes to the PATH environment variable.
  • Permissions: Ensure that you have the necessary permissions to execute commands from the installed package.
  • Virtual Environment: If using a virtual environment, make sure it is activated when you attempt to run the command.

Example Directory Tree

project_directory/
📂 src/
│   📂 main/
│   │   📂 java/
│   │   │   📂 com/
│   │   │       📄 Main.java
│   │   📂 resources/
│   │   │   📂 config/
│   │   │       📄 application.properties
│   │   📂 webapp/
│   │       📄 index.html
│   📂 test/
│   │   📂 java/
│   │   │   📂 com/
│   │   │       📄 MainTest.java
│   │   │       📂 example/
│   │   │           📄 MainTest.java
│   │   📂 resources/
│   │       📂 test_config/
│   │           📄 test.properties
📂 docs/
│   📄 documentation.md
📄 README.md
📄 LICENSE

Note: If you encounter any issues or have suggestions, please submit them here: https://github.com/wiliancirillo/tree-viewer.

Credits This project, tree-viewer, is based on and inspired by the Custom Tree project developed by dragon-devs. Our tool extends the original functionality by providing additional features such as the ability to exclude specific files and directories from the tree output. We are grateful to the original authors and contributors of Custom Tree for their pioneering work which served as a foundation for further development in this tool.

For more details about the original project, please visit their GitHub repository: https://github.com/dragon-devs/custom-tree.

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