drint
is a library that outputs dict
type objects in python to console and other applications, fully formatted and displayed. This will improve debugging, output, and other tasks.
drint
is a library that outputs dict type objects in python to console and other applications, fully formatted and displayed. In general, dict is displayed in python using pprint
, etc., but this library can output dict in a more complete form than pprint
.
drint
displays dict types in perfect alignment.
Below is a test dict and an example of its display.
from dict_viewer.drint import drint
test_d3 = {
"e": "EEE",
"f": "FFF",
"g": "GGG"
}
test_d2 = {
"c": test_d3,
"d": "DDD"
}
test_d1 = {
"a": "AAA",
"b": test_d2
}
# drint
drint(test_d1)
The result is as follows:
{
"a": AAA
"b": {
"c": {
"e": EEE
"f": FFF
"g": GGG
}
"d": DDD
}
}
Compared to the output with pprint and print, it is clearly aligned.
# print
{'a': 'AAA', 'b': {'c': {'e': 'EEE', 'f': 'FFF', 'g': 'GGG'}, 'd': 'DDD'}}
# pprint
{'a': 'AAA', 'b': {'c': {'e': 'EEE', 'f': 'FFF', 'g': 'GGG'}, 'd': 'DDD'}}
# drint
{
"a": AAA
"b": {
"c": {
"e": EEE
"f": FFF
"g": GGG
}
"d": DDD
}
}
Also, with drint, indentation can be specified.
The list of arguments, etc. that can be used in drint
is as follows.
from dict_viewer.drint import drint
drint(
dict, # Required argument
indent # defalut value is 4
)
Latest drint via PyPI (pip install)
pip install drint
pip install git+https://github.com/Domzou-kun/drint.git
or install via SSH
pip install git+git://github.com:Domzou-kun/drint.git
Domzou
- The link to PyPI is here.
If you want to know about past versions, please refer to version history.
drint has a MIT license, as found in the LICENSE file.