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.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.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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47f69369ba17280e7b40d7a774f2dc605d4345a1fd600dcdc2af1c6dbbbda7f3 |
|
MD5 | a2d5c761b32fbeac3c8132a31f68cd7e |
|
BLAKE2b-256 | ea335f0e7b8d0c6379364010112ca95dc945ecf31556b9a90708ceef28da8b57 |
Hashes for path_tree_generator-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1efbcc7610da680612c83c369f0fc84eaf64953abac56f7fdb2e6c2dfc7b3f41 |
|
MD5 | 78349b2c105f5e906fe40df26149c0aa |
|
BLAKE2b-256 | 03e5728d041a3d173ee813a549d5abe28ca3c5edab1ee835f8cc3dc7ec305ef8 |