Generate a recursive tree diagram given a starting directory or a list of URIs.
Project description
treeGenerator
Generate a recursive tree diagram given a starting directory or a list of URIs.
Install with:
pip install treeGenerator
Contains two classes: TreeGenerator and UrlTreeGenerator.
TreeGenerator takes a local file path and recursively generates a tree representation of all subdirectories.
UrlTreeGenerator takes a list of urls and generates a tree representation of them.
Usage:
from treeGenerator import TreeGenerator from pathlib import Path generator = TreeGenerator(Path.cwd()) print(generator)
produces
treeGenerator | |-dist | | |-treegenerator-0.0.1-py3-none-any.whl | | |_treegenerator-0.0.1.tar.gz | | | |-LICENSE.txt | |-README.md | |-pyproject.toml | |-src | | |-treeGenerator | | | |-__init__.py | | | |_treeGenerator.py
The dictionary representing the tree can be accessed through the 'tree' member.
import json print(json.dumps(generator.tree, indent=1))
produces
{ "treeGenerator": { "dist": { "treegenerator-0.0.1-py3-none-any.whl": {}, "treegenerator-0.0.1.tar.gz": {} }, "LICENSE.txt": {}, "README.md": {}, "pyproject.toml": {}, "src": { "treeGenerator": { "__init__.py": {}, "treeGenerator.py": {} } } } }
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
File details
Details for the file treegenerator-0.1.1.tar.gz
.
File metadata
- Download URL: treegenerator-0.1.1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b75530112c7ac37927ca4ac137d795beb311c77bd89118304bbe403931898aff |
|
MD5 | 066f85c216b8c7039423467c639619cd |
|
BLAKE2b-256 | 37db796ce49ec3bf2ec445e499a7e3c90370e8516be44059160c8048015994ff |
File details
Details for the file treegenerator-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: treegenerator-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc6839b4ffbe1a6bc4e1794ad94178afe5176b7180ba8bca688365aa486ebd21 |
|
MD5 | 4a87a810a1463701169b461928221dcc |
|
BLAKE2b-256 | e080a34c187aec96dea4d9cf58ea3cf7fac343aa62af97e751c933aef48887b1 |