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
treegenerator-1.0.1.tar.gz
(37.6 kB
view hashes)
Built Distribution
Close
Hashes for treegenerator-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb1e0b81e3e9bbd73f027cd31b89b2b0855a1b5a506b9a7a21a4c988035206f0 |
|
MD5 | f50c6c6c3ba83b30319999bf90feec36 |
|
BLAKE2b-256 | 94eed9194756137f47782e06f8fbac66cf9c94f15822fa2ffcaaead38e5ca969 |