Skip to main content

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.

Project description

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.

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

tree_viewer-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

tree_viewer-0.1.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file tree_viewer-0.1.1.tar.gz.

File metadata

  • Download URL: tree_viewer-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for tree_viewer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fe03f9eb14d0c8354fcff281c0f116d2733beaaabd6c4381f483ff2bdcdd4716
MD5 886ac3f38c760a4e335553a3f78b4833
BLAKE2b-256 60ac780150763fd1d236212d6f2773d945173e8ea8b2a50d5a4cfc92c240ebdb

See more details on using hashes here.

File details

Details for the file tree_viewer-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tree_viewer-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for tree_viewer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9fbb004c9609184c01361744e3443e802e50217869a4a620e02187c05a916b22
MD5 763fa97329e970062ae5e056f2bb3271
BLAKE2b-256 6ec0872a6657fc7993a26a3a5553ace809601d07e31c1d2d4fdce9f3e5a1d046

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