A cross-platform directory tree visualization tool
Project description
PreTree ๐ณ
A cross-platform Python package for visualizing directory structures in a tree-like format.
Features
- ๐ฅ๏ธ Cross-platform compatibility
- ๐ฒ Tree-like visualization
- ๐ Configurable depth
- ๐ Advanced filtering options
- โก Both CLI and library usage
- ๐ Sorted output (directories first)
- ๐ Size-based filtering
- ๐ฏ Pattern matching
Demo
$ prettree
D:/Codes/FileTree
โโโ dist
โ โโโ prettree-0.1.0-py3-none-any.whl (5,368 bytes)
โ โโโ prettree-0.1.0.tar.gz (4,773 bytes)
โโโ src
โ โโโ prettree
โ โ โโโ __pycache__
โ โ โ โโโ __init__.cpython-313.pyc (244 bytes)
โ โ โ โโโ cli.cpython-313.pyc (2,792 bytes)
โ โ โ โโโ core.cpython-313.pyc (6,148 bytes)
โ โ โโโ __init__.py (88 bytes)
โ โ โโโ cli.py (2,267 bytes)
โ โ โโโ core.py (4,103 bytes)
โ โโโ prettytree
โ โโโ __init__.py (1 bytes)
โโโ tests
โ โโโ test_prettree.py (1,384 bytes)
โโโ ~
โโโ LICENSE.md (1,096 bytes)
โโโ pyproject.toml (1,170 bytes)
โโโ README.md (1,966 bytes)
Installation
pip install prettree
Usage
Basic Usage
# List current directory
prettree
# List specific directory
prettree /path/to/directory
Advanced Options
# Show hidden files
prettree -a
# Limit depth to 2 levels
prettree -d 2
# Show only files (no directories)
prettree -f
# Show only directories
prettree -D
# Exclude empty directories
prettree -e
# Show only PDF files
prettree -p "*.pdf"
# Exclude configuration files
prettree -x "*.config"
# Show files larger than 1MB
prettree --min-size 1048576
# Show files between 100KB and 1MB
prettree --min-size 102400 --max-size 1048576
As a Python Library
from prettree import list_directory
# Basic usage
for item in list_directory():
print(item)
# Advanced usage
for item in list_directory(
"/path/to/directory",
max_depth=2,
show_hidden=True,
only_files=True,
file_pattern="*.pdf",
min_size=1048576
):
print(item)
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prettree-0.1.1.tar.gz
(5.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prettree-0.1.1.tar.gz.
File metadata
- Download URL: prettree-0.1.1.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c5f6d82e8bf2822d599470cb2a2d13e1b20c41a4ba02170807452b6c547f726
|
|
| MD5 |
a843f49847975429b8a30436491fa695
|
|
| BLAKE2b-256 |
de52129e5f9f6e891334e95ed64ab840502267f86f4d85661063384dd864151a
|
File details
Details for the file prettree-0.1.1-py3-none-any.whl.
File metadata
- Download URL: prettree-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f282e2aa4516f53e0d3258bd5ea9ad4428b5061196ebecc49d7adce6908093a6
|
|
| MD5 |
5c95a6252b3e8bbe9bd4e2c84b8ae25e
|
|
| BLAKE2b-256 |
ab8bfa315cc02a88c8e4793ebf167a7ee5679fd218bf45a90c4958534d3bb89c
|