visualize the tree structure of any recursable object in python
Project description
Visual Tree Python Package
Introduction
this is a simple tool to visualize the tree structure of any recursable object in python.
Installation
pip install visual-tree
Usage
from visual_tree import build_tree
tree = build_tree(data_structure)
# print the data_structure
print(tree)
# print the tree directly
tree()
# get the tree as a string (member of tree)
tree.tree
# get the tree as a list of strings (__iter__)
list(tree)
Example
look at the example.py file for more examples.
requirements
- python needs to be installed
- data structure with
__iter__(better with__len__also) - data structure with
__bool__ - data structure with
__str__
or
- instand of
__iter__you can use other extending methods pass withmkchildparameter - instand of
__bool__you can use other extending methods pass withvalidparameter
License
Apache License 2.0 (see LICENSE file)
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
visual-tree-1.0.1.tar.gz
(7.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file visual-tree-1.0.1.tar.gz.
File metadata
- Download URL: visual-tree-1.0.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd819890a6f528b7065f0af337f5d57f5ecd086663cd2950e1c09303fc827f89
|
|
| MD5 |
b4719dcf77a94b3af8cf1dc1fbcefdb3
|
|
| BLAKE2b-256 |
bf5881e78f4b595fcb144503bbcba015a02d5740c6a17ae84078da172c946196
|
File details
Details for the file visual_tree-1.0.1-py3-none-any.whl.
File metadata
- Download URL: visual_tree-1.0.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
755ef678492aa89ba1e1f8a61bc1e7cfcd15564cb2548fe7e92567ce42508341
|
|
| MD5 |
8572b82baddab4b5d3948925e897165c
|
|
| BLAKE2b-256 |
9ea058830076b826bea2a0328994437290a42117c4f03a0f7d4a51dec5b83eee
|