Skip to main content

Generate human-readable directory listings in a tree-like format as `list[str]`, `dict` or `json`

Project description

path-tree-generator

Generate human-readable directory listings in a tree-like format as 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.1 and contains the most base implementations.

More to come for path-tree-generator v0.1.0:

  • Adding a "better" getter methods naming
  • Extend tests to check all possible parameters of a method or class
  • ...

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

Python 3.10+

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

path-tree-generator-0.0.1.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

path_tree_generator-0.0.1-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page