Generate tree-like directory listings also for humans, output them as `str`, `list[str]`, `dict` or `json`.
Project description
path-tree-generator
Generate tree-like directory listings also for humans, output them as str
, list[str]
, dict
or json
.
from path_tree_generator import PathTree
pt = PathTree('/my/path/to/generate')
print(
pt.get_human_readable()
)
ATTENTION: NOT FULLY IMPLEMENTED YET :construction:
:warning: CURRENTLY THIS PACKAGE IS UNDER HEAVY DEVELOPMENT AND NOT FULLY IMPLEMENTED YET! :warning:
The fist working (early) version is released as path-tree-generator v0.0.2 and contains the most base implementations.
More to come for path-tree-generator v0.1.0:
- Adding a "better" getter methods naming
- ...
But keep in mind that classes, methods and their signatures might change anytime during development till the first official release 1.0.0.
Table of Contents
Requirements
path-tree-generator
depends on the following packages:
- Pydantic for data models and validation
Usage
Installation
pip install path-tree-generator
Example
from path_tree_generator import PathTree
pt = PathTree('/my/path/to/generate')
print(
pt.get_human_readable()
)
The code above outputs a tree-like formatted recursive directory listing. Directories are wrapped in square brackets, files aren't.
[data]
├── data.json
├── data.tree
├── [myDirectory-1]
│ ├── myFile.txt
│ └── [subdirectory]
│ └── green.gif
└── [myDirectory-2]
├── [subdirectory1]
│ └── green.gif
└── [subdirectory2]
├── myFile.txt
└── myFile2.txt
Support
If you're opening issues, please mention the version that the issue relates to.
Contributing
To contribute to this project, fork the repository, make your changes and create a pull request.
License
This project is licensed under the terms of the MIT license.
Known Issues
- Python version compatibility < v3.10 is not tested yet
- Getter methods aren't named perfectly, this will be solved in a future version
- Not all tests are fully implemented yet
Project details
Release history Release notifications | RSS feed
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
Hashes for path-tree-generator-0.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6410f772e02408c94c9174f5944844cb5c34ff88dba4eac296b1ea1e0bc2fed3 |
|
MD5 | 7557ab79d1b81b60e2b0afefc1a5fc81 |
|
BLAKE2b-256 | fa13e706af1d4e0a2f95d320933ae3573329673fdf61ab63d1aee4cfc6bf8948 |
Hashes for path_tree_generator-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c35a8a5aa756a075fed748d0786e8409e39dd1478aeb5c1d915e1a41dd4d7e7 |
|
MD5 | 67145b296f3e28a9b715394f663dc5df |
|
BLAKE2b-256 | 013aa0ccb8eb94aba8e01a93e3e0c808006bcbf01f72545b53aad8b708db4f0f |