medium.com

Yair Lenga: jsonfold: Making Pretty-Printed JSON Compact and Readable Again in Python (opens in new tab)

Covered by DEV Community

Most JSON serializers force a choice between compact machine output and fully expanded pretty-printing\. This article explores a middle ground: a hybrid JSON formatter for Python that keeps nested payloads readable while still remaining compact\. Example output: \{ \"meta\": \{ \"version\": 1, \"ok\": true \}, \"ids\": \[ 1, 2, 3, 4 \], \"matrix\": \[ \[1, 2\], \[3, 4\] \] \} The article also discusses streaming formatting, bounded buffering, width-aware layout decisions, and incremental proc...

Read the original article
Sign in to keep reading the full article.

Covered in 1 article

DEV Community·
Discussed on DEV
Feeds

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help