Skip to main content

A CLI tool for generating a clear, hierarchical view of a file system.

Project description

File-System Tree Viewer Logo

๐ŸŒณ File-System Tree Viewer

PyPI Version Python Versions License

A lightweight command-line tool for generating a clear, hierarchical view of a file system โ€” combining the familiarity of the Unix tree command with rich colorization, glob-pattern exclusions, directory depth control, and cross-platform flexibility.

๐Ÿ“‘ Table of Contents

๐Ÿš€ Features

  • ๐Ÿ“‚ Recursive tree output for viewing nested directories and files.
  • ๐Ÿ“ Adjustable depth to limit how many directory levels are shown.
  • ๐Ÿšซ Pattern exclusion to hide items using glob patterns (*.pyc, venv).
  • ๐ŸŽจ Colorization support with named colors and 24-bit RGB.
  • โœจ Bold tree branches for enhanced readability in the terminal.
  • ๐Ÿ“ Directory-only mode to omit files from the view.
  • ๐Ÿ’พ File export support to save your tree as a .txt file.
  • โœ… Cross-platform for Windows, macOS, and Linux.

๐Ÿงฉ Installation

Install via pip:

pip install file-system-tree-viewer

Or clone manually:

git clone https://github.com/RoyEshel/file-system-tree-viewer.git
cd file-system-tree-viewer
pip install .

๐Ÿ’ป Usage

After installation, run the CLI command:

fs-tree [OPTIONS]

Example:

fs-tree --root-dir . --exclude "*.pyc" "node_modules" "*-env" --dir-color red --file-color 255,255,0 --output-path output/tree.txt

๐Ÿ› ๏ธ Options

Option Description Default
--root-dir Root directory from which the tree traversal begins .
--depth Maximum number of directory levels to show, including their contents (0 = show all levels) 0
--exclude Space-separated list of glob patterns to exclude files or directories by name None
--dirs-only Show only directories False
--indent Number of spaces per indentation level 4
--bold Use bold box-drawing characters for branches False
--dir-color Color for directory names None
--file-color Color for file names None
--output-path Directory or .txt file path for writing the tree output instead of printing to the terminal None

๐ŸŽจ Color Options

Directory and file names can be colorized using either:

  • Named colors:
    black, red, green, yellow, blue, magenta, cyan, white

  • RGB values in the form R,G,B (no quotes needed):
    Example: --file-color 255,128,0

Note:
Colorization is disabled automatically when writing output to a file.
Some terminals may not support 24-bit RGB sequences.

๐Ÿชต Example Output

project-root
โ”œโ”€โ”€ src
โ”‚   โ”œโ”€โ”€ main.py
โ”‚   โ””โ”€โ”€ utils
โ”‚       โ””โ”€โ”€ helpers.py
โ”œโ”€โ”€ tests
โ”‚   โ””โ”€โ”€ test_main.py
โ””โ”€โ”€ README.md

โš–๏ธ License

This project is licensed under the GNU General Public License v3 or later.
See the LICENSE.txt file for details.

๐Ÿง‘๐Ÿปโ€๐Ÿ’ป Maintainer

Roy Eshel
๐Ÿ”— GitHub: RoyEshel
๐Ÿ“ฌ Preferably contact via GitHub Issues for questions, bug reports, or feature requests.

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

file_system_tree_viewer-1.0.0.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

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

file_system_tree_viewer-1.0.0-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file file_system_tree_viewer-1.0.0.tar.gz.

File metadata

  • Download URL: file_system_tree_viewer-1.0.0.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for file_system_tree_viewer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3d6285e26e75c5af7df1aa7ee9299af7d3e67f18b48828cf4f6d2e30ff37a03a
MD5 6349de398aa1066877e495912be0077e
BLAKE2b-256 5aa1e0aba9133f15091170e8bc10b6e1076b1037352e5ee7a1a1c2aa8822b7dd

See more details on using hashes here.

File details

Details for the file file_system_tree_viewer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for file_system_tree_viewer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f94295b0f92f2d80b7d7ff51ab60006b696d5cec46448f57165938072a11bd66
MD5 e749ad205e26d92ebf97fdfe50cce654
BLAKE2b-256 28cf966bc07a1e6ca9236d76b69822a27d7866ff2339aef95ffd432bb1022da6

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