-
Notifications
You must be signed in to change notification settings - Fork 0
Home
brianburwell11 edited this page Jun 21, 2022
·
7 revisions
Generate prettier and more compact JSON dumps
prettier_json can be installed directly from the GitHub repository using one of these commands:
pip install git+ssh://git@github.com/brianburwell11/prettier-json.git@masterpoetry add git+ssh://git@github.com/brianburwell11/prettier-json.git#masterbasictype2str(obj)
:
getsubitems(obj, itemkey, islast, maxlinelength, indent)
:
indentitems(items, indent, level)
: Recursively traverses the list of json lines, adds indentation based on the current depth
prettyjson(obj, indent=2, maxlinelength=80)
: Renders JSON content with indentation and line splits/concatenations to fit maxlinelength.
Only dicts, lists and basic types are supported