pprint_tree
prints tree (where nodes have multiple children) in human readable format
Installation
pip install pprint_tree
Quickstart
class Node:
def __init__(self, val):
self.val = val
self.children = []
root = Node("apple")
root.children.append(Node("orange"))
root.children.append(Node("pear"))
root.children.append(Node("pineapple"))
root.children.append(Node("banana"))
root.children[0].children.append(Node("orange1"))
root.children[0].children.append(Node("orange2"))
root.children[1].children.append(Node("pear1"))
root.children[1].children[0].children.append(Node("pear2"))
root.children[1].children[0].children[0].children.append(Node("pear3"))
root.children[1].children[0].children[0].children.append(Node("pear4"))
root.children[2].children.append(Node("kiwi"))
root.children[2].children.append(Node("avocado"))
root.children[2].children.append(Node("cherry tomatoes"))
root.children[2].children.append(Node("golden kiwi"))
root.children[2].children.append(Node("soup"))
from pprint_tree import pprint_tree
pprint_tree(root)
"""
____________________________________________apple__________________________________________
| | | |
_____orange_______ pear ___________________pineapple__________________ banana
| | | | | | | |
orange1 orange2 pear1 kiwi avocado cherry tomatoes golden kiwi soup
|
____pear2_______
| |
pear3 pear4
"""
Metadata
Release files for pprint-tree 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pprint_tree-0.0.3.tar.gz | 5.0 kB | Without provenance | Details for pprint_tree-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pprint_tree-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for pprint_tree-0.0.3-py3-none-any.whl |
Total release size: 11.0 kB
Release files / pprint_tree-0.0.3.tar.gz
| Download URL | pprint_tree-0.0.3.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb02d1c978af1bdfb9d0bcb4579964f8c3d50e6de2d408892aa95148e97ed116
|
|
BLAKE2b-256 checksum How to use checksums |
d386e86bf1c8ba753d977ed3b3b4250cf0d8c00f100d0be282b41d9e430f76dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.0
|
Release files / pprint_tree-0.0.3-py3-none-any.whl
| Download URL | pprint_tree-0.0.3-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d4fb98fb44588233060742a1f041dbae3e10999b26863ba6412823a535cebf09
|
|
BLAKE2b-256 checksum How to use checksums |
25fc2d88666d71bb42fbd34b2f0c5bdb9f84b50a07e9b70f9084b241d069dc32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.0
|
Security for pprint-tree 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.