Welcome
Welcome to the exprint documentation.
What is exprint ?
exprint is a small Python package for helping you to explore easly and quickly your data by pretty-printing values with a flexible API. exprint is inspired by NodeJS pretty-printing and Formatter API in Rust.
-
Easy to use
Implements concise code to explore your data
-
No dependencies
exprintrequires no dependencies and is written 100% in Python. -
Open Source
exprintis licensed under MIT.
Installation
exprint is available on PyPi.
Example
import json
from exprint import exprint
# https://github.com/topojson/us-atlas?tab=readme-ov-file#counties-10m.json
with open("./counties-10m.json") as file:
data = json.load(file)
exprint(data, max_elements=10)
In your terminal, you will have a c o l o r e d output.
{
'type': 'Topology',
'bbox': [ -179.14733999999999, -14.552548999999999, 179.77847, 71.352561 ],
'transform': {
'scale': [ 0.003589293992939929, 0.0008590596905969058 ],
'translate': [ -179.14733999999999, -14.552548999999999 ],
},
'objects': {
'counties': { 'type': 'GeometryCollection', 'geometries': [list] },
'states': { 'type': 'GeometryCollection', 'geometries': [list] },
'nation': { 'type': 'GeometryCollection', 'geometries': [list] },
},
'arcs': [
[ [list], [list] ],
[ [list], [list], [list] ],
[ [list], [list] ],
[ [list], [list], [list], [list] ],
[ [list], [list] ],
[ [list], [list] ],
[ [list], [list] ],
[ [list], [list], [list], [list], [list], [list], [list], [list], [list], [list] ],
[ [list], [list] ],
[ [list], [list], [list], [list], [list], [list], [list], [list], [list], [list] ],
... 9859 more items
],
}