Skip to main content

RP Tree, a directory tree generator

Project description

distillation-rptree

RP Tree is a fast, simple directory tree generator with optional sorting, icons, and colorized output.

Features

  • Directory-only mode
  • Optional sorting (directories first, then files, alphabetically)
  • Optional icons for folders and common file types
  • Optional ANSI color output (stdout only)
  • Write output to a file

Install

From PyPI:

pip install distillation-rptree

From TestPyPI:

pip install -i https://test.pypi.org/simple/ distillation-rptree

CLI Usage

After installation, the CLI is available as rptree:

rptree .
rptree . --sort-tree --icons --color
rptree . --dir-only
rptree . -o tree.md

To run from source without installing:

python -m distillation_rptree.cli .

Options

usage: tree [-h] [-v] [-d] [-o [OUTPUT_FILE]] [-s] [--icons] [--color] [ROOT_DIR]

RP Tree, a directory tree generator

positional arguments:
  ROOT_DIR              Generate a full directory tree starting at ROOT_DIR

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -d, --dir-only        Generate a directory-only tree
  -o, --output-file [OUTPUT_FILE]
                        Generate a full directory tree and save it to a file
  -s, --sort-tree       Sort directories and files alphabetically within each level
  --icons               Show icons for directories and files
  --color               Use ANSI colors in the tree output (stdout only)

Thanks for using RP Tree!

Python API

from distillation_rptree.rptree import DirectoryTree

tree = DirectoryTree(
    ".",
    dir_only=False,
    output_file=None,
    sort_tree=True,
    show_icons=True,
    use_color=True,
)
tree.generate()

Note: use_color only applies when printing to stdout.

Development

Build the package:

uv run python -m build

License

MIT

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

distillation_rptree-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

distillation_rptree-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: distillation_rptree-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for distillation_rptree-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2a3d2db31261bcfb8b792b7c4844570a5c2fd732fc64b40a5a045549f1a6d417
MD5 810b06a34ef24cb855574a06a0ee8211
BLAKE2b-256 bbe2fa5e1d33a522b706589b0e37ae18b5115ea49e3cb77f1db710f881bf115a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for distillation_rptree-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 874f6519dc408346e2a75ef05276d69fc47e83fba2325ff63f919784917b900b
MD5 1b79a2a62e30f359c44f88c34731d899
BLAKE2b-256 12dd9738eb5d96ebe31e57a28b5be77c9eb8962db7d0081caa92651e9e9a0f8b

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