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-0.0.2.tar.gz
(5.7 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-0.0.2.tar.gz.
File metadata
- Download URL: visual-tree-0.0.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aee10ccf3dfaa489bfff05f13ada97f27cde04badf3d1e81a79c34f2f6c00edd
|
|
| MD5 |
f2564710fdbd5ecf58903b2d287482d2
|
|
| BLAKE2b-256 |
2f5ecbed66372a844ea009e00870bcfb4fb6258f3d1bb812848ffeb013e44ed9
|
File details
Details for the file visual_tree-0.0.2-py3-none-any.whl.
File metadata
- Download URL: visual_tree-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea30f50919585c5155a303fbd5e4cead9294285eba933016875a80ac336e0487
|
|
| MD5 |
f22eea8410f0e5f8d2c5f18a6848dc9b
|
|
| BLAKE2b-256 |
e81ad66d5c22ab887ba04d7e9e9e9c2809264c00c9815ad3740f620b91632487
|