Print a directory tree structure in your Python code.
Project description
directory-structure
Print a directory tree structure in your Python code.
Download
You can simply:
pip install directory-structure
Or you can also:
- Clone the repository to your local machine.
- Enter the directory.
- Download necessary modules/libraries.
git clone https://github.com/gabrielstork/directory-structure.git
cd directory-structure
pip install -r requirements.txt
Examples
from directory_structure import Tree
Using absolute path as an argument.
path = Tree('C:/Users/User/Desktop/directory-structure', absolute=True)
print(path)
๐ C:
|_๐ Users
|_๐ User
|_๐ Desktop
|_๐ directory-structure
|_๐ .git
|_๐ directory_structure
|_๐ .gitignore
|_๐ LICENSE
|_๐ pyproject.toml
|_๐ README.md
|_๐ requirements.txt
|_๐ setup.py
path = Tree('C:/Users/User/Desktop/directory-structure', absolute=False)
print(path)
๐ directory-structure
|_๐ .git
|_๐ directory_structure
|_๐ .gitignore
|_๐ LICENSE
|_๐ pyproject.toml
|_๐ README.md
|_๐ requirements.txt
|_๐ setup.py
Accessing a folder in current working directory.
path = Tree('./directory_structure', absolute=True)
print(path)
๐ C:
|_๐ Users
|_๐ User
|_๐ Desktop
|_๐ directory-structure
|_๐ directory_structure
|_๐ tree.py
|_๐ __init__.py
path = Tree('./directory_structure', absolute=False)
print(path)
๐ directory_structure
|_๐ tree.py
|_๐ __init__.py
Getting all from the directory where your current working directory is.
path = Tree('../', absolute=True)
print(path)
๐ C:
|_๐ Users
|_๐ User
|_๐ Desktop
|_๐ directory-structure
|_๐ Discord.lnk
|_๐ Spotify.lnk
|_๐ Steam.lnk
|_๐ Telegram.lnk
|_๐ Visual Studio Code.lnk
|_๐ WhatsApp.lnk
path = Tree('../', absolute=False)
print(path)
๐ Desktop
|_๐ directory-structure
|_๐ Discord.lnk
|_๐ Spotify.lnk
|_๐ Steam.lnk
|_๐ Telegram.lnk
|_๐ Visual Studio Code.lnk
|_๐ WhatsApp.lnk
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
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 directory-structure-1.1.2.tar.gz.
File metadata
- Download URL: directory-structure-1.1.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e43f579c2dc41b8f5d814d43b38abf51c169c0e1bcbbc84faef477d747e079b0
|
|
| MD5 |
18646df8e4e800001971c392287b7816
|
|
| BLAKE2b-256 |
b01021c893bfa9dd302e0b8fcb23f17efbf20f0cfbbb3b84b37e4d15c66aa3d2
|
File details
Details for the file directory_structure-1.1.2-py3-none-any.whl.
File metadata
- Download URL: directory_structure-1.1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce053f71e8ab2aaf77a88e26ca3e729acf6ecf828b43db0eeac3858ae62dd259
|
|
| MD5 |
ae83883740e367ba6aaae2d340f3007c
|
|
| BLAKE2b-256 |
692498f287bc87651187d030caa579e3d91cb48b73bb103f3b3a4cb8eed2074f
|