Easily print a complex data structure for readability
Project description
Prettyprint
Easily print a complex data structure
Support
| OS | Terminal | Support |
|---|---|---|
| Linux | TTYs | Full |
| Linux | Konsole | Full |
| Linux | Yakuake | Full |
| Windows | Command prompt | Part [0] |
| Windows | Powershell | Part [0] |
| Windows | Windows Terminal | Full |
| macOS | Terminal | Full |
| Code | Missing |
|---|---|
| 0 | Text colours |
Is your terminal not included? Create a PR and add it, along with its support level.
Usage
import prettyprint
"""
prettyprint.pprint(
data=any, # Data to print
indent: int = 4, # How far indented each list, tuple etc. should be indented
show_types: bool = False, # If the type of each item should be shown e.g. <int>
colour_coded: bool = True, # If colours should be used to show different types
cutoff: bool = True, # If text over multiple lines should be cut off
debug: bool = False # Show length of itterables
)
"""
# Enabling debug will automatically enable show_types
prettyprint.pprint(
{"a": [1, 2], "b": {1.4, False}, "c": [1, 2, [3, (4, 5)]]},
debug=True
)
"""
<dict | Length: 3> {
<str | Length: 1> a: <list | Length: 2> [
<int> 1
<int> 2
]
<str | Length: 1> b: <set | Length: 2> {
<bool> False
<float> 1.4
}
<str | Length: 1> c: <list | Length: 3> [
<int> 1
<int> 2
<list | Length: 2> [
<int> 3
<tuple | Length: 2> (
<int> 4
<int> 5
)
]
]
}
"""
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 pineaprint-1.0.3-py2.py3-none-any.whl.
File metadata
- Download URL: pineaprint-1.0.3-py2.py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2121b277b634b708e7616057d1864698190afd5c2d747b70bcfc889bfe4d864
|
|
| MD5 |
0c409caa08e4ab7229a20a17fa4c1782
|
|
| BLAKE2b-256 |
392b11735fe9500c083f0e31ba1f3f8396a9947da063dcb5ccd9b758884e5c83
|