Skip to main content

Print directory tree.

Project description

dir_tree

print directory tree

Similar as tree in terminal.

Install

pip install dir-tree

How to use

Import tree function:

from dir_tree.dir_tree import tree
tree('test_dir')
 test_dir  - 3 dirs 0 files
     sub_dir_1  - 4 dirs 0 files
         sub_dir_1_1  - 0 dirs 0 files
         sub_dir_1_2  - 0 dirs 0 files
         sub_dir_1_3  - 0 dirs 0 files
         sub_dir_1_4  - 0 dirs 0 files
     sub_dir_2  - 5 dirs 0 files
         sub_dir_2_1  - 0 dirs 0 files
         sub_dir_2_2  - 0 dirs 0 files
         sub_dir_2_3  - 0 dirs 0 files
         sub_dir_2_4  - 0 dirs 0 files
         sub_dir_2_5  - 0 dirs 0 files
     sub_dir_3  - 6 dirs 0 files
         sub_dir_3_1  - 0 dirs 0 files
         sub_dir_3_2  - 0 dirs 0 files
         sub_dir_3_3  - 0 dirs 0 files
         sub_dir_3_4  - 0 dirs 0 files
         sub_dir_3_5  - 0 dirs 0 files
         sub_dir_3_6  - 0 dirs 0 files

You can sent string or Path object to tree function.

from pathlib import Path
path = Path('test_dir')

Now we can use path:

tree(path)

And we can 'patch' Path as:

`Path.tree = tree'

Now we can use it as:

path.tree()

And better, if you use fastcore, you can patch it using @patch decorator.
I didnt use it becouse won't use any dependences.

Now it has only base functionality.
In plans: ipywidgets and cl functionalitys.

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

dir_tree-0.0.2.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

dir_tree-0.0.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file dir_tree-0.0.2.tar.gz.

File metadata

  • Download URL: dir_tree-0.0.2.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for dir_tree-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9ad49c731375971976e1cf5fbed9a27776bfa52a8cab315c344586643e85539b
MD5 97f92f424536ebdc40a74913608166ca
BLAKE2b-256 3fd2b300c3d97706e05b3bdd7be36fa1989485476a2bacadc4f2a82a9548c811

See more details on using hashes here.

File details

Details for the file dir_tree-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dir_tree-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for dir_tree-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fc37b8756bba6e60799a3f0f0254dc36e605211007c9a71f3343768327e17fd0
MD5 8b3b90a479a58d43655a771c6d19db8f
BLAKE2b-256 8a60e1eed196ea6c8644877851246a2d823d93b3e20e4ff388363cf6f117ed00

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