Skip to main content

Utility Package that displays out the Tree Structure of a Particular Directory.

Project description

Directory Tree Package

Setup Automated Test passing Python Version Last Commit Open Source Love png2

About

Want to display your project/current working directory as a neat tree? No Worries!

Directory Tree is a simple python utility package that displays out the Tree Structure of a user-defined directory.

Currently Available for All Platforms.

Installation

Run the following command on your terminal to install directory_tree:

1 . Installing the package using pip:

pip install directory_tree

OR

pip3 install directory_tree

2 . Cloning the repository:

git clone https://github.com/rahulbordoloi/Directory-Tree/
cd Directory-Tree
pip install -e .

Usage

Run this script in order to print out the tree structure of a user-defined directory!

# Importing Libraries
from directory_tree import display_tree

# Main Method
if __name__ == '__main__':
    display_tree(directory_path)
  • Here by default, the directory_path is the current working directory (CWD) unless specified by the user.

Output

  1. For Current Working Directory [DEFAULT]
>>> from directory_tree import display_tree
>>> display_tree()

$ Operating System : Windows
$ Path : C:\Personal\Work\Directory-Tree\Test\Main Directory

*************** Directory Tree ***************

Main Directory/
âœâ”€â”€ Directory 1/
│   └── Directory 2/
│       âœâ”€â”€ Directory 3/
│       │   └── Directory 4/
│       │       └── Hello World.txt
│       └── Say World.txt
âœâ”€â”€ Directory A/
│   └── Hmm.txt
âœâ”€â”€ directory-tree-print.cpp
âœâ”€â”€ letseee.txt
└── printTree.exe
  1. For User Specified Directory [Argument]
>>> from directory_tree import display_tree
>>> display_tree('C:\Personal\Work\Directory-Tree\Test\Main Directory')

$ Operating System : Windows
$ Path : C:\Personal\Work\Directory-Tree\Test\Main Directory

*************** Directory Tree ***************

Main Directory/
âœâ”€â”€ Directory 1/
│   └── Directory 2/
│       âœâ”€â”€ Directory 3/
│       │   └── Directory 4/
│       │       └── Hello World.txt
│       └── Say World.txt
âœâ”€â”€ Directory A/
│   └── Hmm.txt
âœâ”€â”€ directory-tree-print.cpp
âœâ”€â”€ letseee.txt
└── printTree.exe

Developing Directory Tree

To install directory_tree, along with the tools you need to develop and run tests, and execute the following in your virtualenv:

$ pip install -e .[dev]

Security & Bugs

  • Directory Tree uses recursion. It will raise a RecursionError on really deep directory trees.
  • As the tree is lazily evaluated, it should behave well on really wide directory trees. Immediate children of a given directory are not lazily evaluated, though. It would be prompted to the last.
  • Currently Directory Tree doesn't support the functionality of ignoring files/directories in a particular path, so will print every files-directories present in the given path.
  • If you're a Windows user, it is always advised to use \\ instead of \ in the address as using \ might catchup escape sequences and corrupt the address string.

Contact Author

Name : Rahul Bordoloi
Website : https://rahulbordoloi.me
Email : rahulbordoloi24@gmail.com

forthebadge made-with-python ForTheBadge built-with-love

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

directory_tree-0.0.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

directory_tree-0.0.1-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file directory_tree-0.0.1.tar.gz.

File metadata

  • Download URL: directory_tree-0.0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6

File hashes

Hashes for directory_tree-0.0.1.tar.gz
Algorithm Hash digest
SHA256 91b32746f3075dca5c0f9435d5584f4f3fb21a74ae626a1019c87867b8dbe190
MD5 15130ed8355f0c4794ba1f50fa427319
BLAKE2b-256 eae720cabb7dcba2ac51abf97322cdaf3353d9374e9c2a459ace40aa00dee826

See more details on using hashes here.

File details

Details for the file directory_tree-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: directory_tree-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.6

File hashes

Hashes for directory_tree-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 535299f29b0b4df776a0ba530e037cb4bd4012f7a8eac048f9f0eaf43a64f800
MD5 abb412ad195c7258b3c35db5b4ccfa44
BLAKE2b-256 fd18e9a12faf5ce168e8e6a74d044505a0b68cae1de0b5160526a754cf1b7456

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page