rahulbordoloi / Directory-Tree

Python Utility Package that displays out the Tree Structure of a Particular Directory.
https://pypi.org/project/directory-tree/
GNU General Public License v3.0
32 stars 13 forks source link

AbstractTree #19

Closed lverweijen closed 3 months ago

lverweijen commented 9 months ago

Hi,

I wanted to let you know that I recently created a package AbstractTree. It can be used to make somewhat similar output as Directory-Tree, but it can also print other kinds of trees.

When used like this:

from pathlib import Path

from abstracttree import print_tree

# The lambda will hide hidden files
print_tree(Path('.'), keep=lambda n, it: not str(n).startswith("."))

This will print:

├─ CHANGELOG.md
├─ CODE_OF_CONDUCT.md
├─ images
│  ├─ images\CWDwithHeader.png
│  ├─ images\SampleDirectoryTree.png
│  ├─ images\UserSpecifiedDirectoryMaxDep.png
│  └─ images\UserSpecifiedDirectoryStrRepShowHidden.png
├─ LICENSE
├─ MANIFEST.in
├─ README.md
├─ setup.py
├─ src
│  └─ src\directory_tree.py
└─ Test
...

which looks similar to what Directory-Tree prints.

If you have any ideas or suggestions, let me know. Or feel free to close this issue for being off topic.