WeSearch

Making Pretty-Printed JSON Readable Again in Python

·2 min read · 0 reactions · 0 comments · 13 views
#programming#python#backend#opensource
Making Pretty-Printed JSON Readable Again in Python
⚡ TL;DR · AI summary

A new Python module called jsonfold has been developed to improve the readability of JSON data. This module acts as a post-processing filter on top of existing JSON serializers, allowing for a balance between compact and fully expanded formats. It offers customization options for formatting, making it suitable for handling large documents efficiently.

Key facts
Original article
DEV.to (Top)
Read full at DEV.to (Top) →
Opening excerpt (first ~120 words) tap to expand

try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 1298982) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Yair Lenga Posted on May 24 • Originally published at Medium Making Pretty-Printed JSON Readable Again in Python #programming #python #backend #opensource Most JSON serializers give you only two choices: compact machine output: {"a":{"b":{"c":"abc"}},"x":{"y":{"z":"xyz"}}} Enter fullscreen mode Exit fullscreen mode or fully expanded “pretty-print”: { "a": { "b": { "c": "abc" } }, "x": { "y": { "z": "xyz" } } } Enter fullscreen mode Exit fullscreen mode I wanted something in between:…

Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from DEV.to (Top)