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-1.0.1.tar.gz
.
File metadata
- Download URL: treegenerator-1.0.1.tar.gz
- Upload date:
- Size: 37.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 | 9398d46a0a7c9d8fda6b5708d4a5a2d1a17a2e06315262ca3cae295fd12a3eec |
|
MD5 | bf35f29a10d835a77ac38547bdfb73f1 |
|
BLAKE2b-256 | eb92db2d43fdcacef994819b901f44c1ae5003377101c3a439cdc57b3c78829b |
File details
Details for the file treegenerator-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: treegenerator-1.0.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 | fb1e0b81e3e9bbd73f027cd31b89b2b0855a1b5a506b9a7a21a4c988035206f0 |
|
MD5 | f50c6c6c3ba83b30319999bf90feec36 |
|
BLAKE2b-256 | 94eed9194756137f47782e06f8fbac66cf9c94f15822fa2ffcaaead38e5ca969 |