A CLI utility to print directory structure.
Project description
pytree
Simplified clone of the Linux tree command.
Supports displaying directory tree structure with colored output, icons, filesizes, filtered views and more. This utility prints as it scans the directories and can be interrupted anytime by pressing CTRL+C.
Example output
$ python -m pytree -is
๐ pytree
โโโ ๐ setup.py [303]
โโโ ๐ LICENSE [1065]
โโโ ๐ .gitignore [1799]
โโโ ๐ README.md [818]
โโโ ๐ tests
โ โโโ ๐ requirements.txt [187]
โโโ ๐ pytree
โโโ ๐ __main__.py [4699]
โโโ ๐ formatter.py [223]
โโโ ๐ common.py [1205]
โโโ ๐ sizes.py [334]
โโโ ๐ __init__.py [34]
โโโ ๐ fonts.py [1458]
โโโ ๐ icons.py [541]
2 directories, 12 files
Installation
From PYPI
pip install tree-print
From source
git clone https://github.com/maxcurzi/pytree.git
python -m pip install -e pytree
Test if it works
$ cd pytree
$ python -m pytree
pytree
โโโ setup.py
โโโ LICENSE
โโโ .gitignore
โโโ README.md
โโโ tests
โ โโโ requirements.txt
โโโ pytree
โโโ __main__.py
โโโ formatter.py
โโโ common.py
โโโ sizes.py
โโโ __init__.py
โโโ fonts.py
โโโ icons.py
2 directories, 12 files
Usage
python -m pytree [-h] [-d] [-f FILT] [-i] [-c] [-s] [path]
positional arguments:
path Path to print (defaults to current)
options:
-h, --help show this help message and exit
-d, --dir Only show directories
-f FILT, --filt FILT Filter out files and folders (supports shell-style wildcards such as ? and *)
-i, --icons Display icons
-c, --color Color output
-s, --size Show the file size
Compatibility notes
Should work on both Windows and Linux.
Icons are UTF-8 encoded and may not display correctly on your terminal.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
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
File details
Details for the file tree-print-0.0.0.tar.gz.
File metadata
- Download URL: tree-print-0.0.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b39541f48d12088628458a15768769a253c12e60cd759be95364c4eb56aa308a
|
|
| MD5 |
c708307c83650be6956923856e33fea0
|
|
| BLAKE2b-256 |
1f2db20a13ecd6affa10ba17d847e10533e1be0e6aa621eeff4eda0bcfaeb546
|