<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:atom="http://www.w3.org/2005/Atom" >

  <channel>
    <title>Yair Lenga - Python Articles</title>
    <link>https://yairlenga.github.io/articles/</link>
    <atom:link href="https://yairlenga.github.io/articles/feed/python.xml"
           rel="self"
           type="application/rss+xml" />
    <description>Python and systems programming articles</description>
    <language>en-us</language>

    <item>
      <title>jsonfold: Making Pretty-Printed JSON Compact and Readable Again in Python</title>

      <link>https://medium.com/@yair.lenga/a-streaming-json-formatter-that-works-with-existing-serializers-eced220da37d</link>

      <guid isPermaLink="true">
        https://medium.com/@yair.lenga/a-streaming-json-formatter-that-works-with-existing-serializers-eced220da37d
      </guid>

      <pubDate>Wed, 27 May 2026 12:00:00 GMT</pubDate>

      <category>python</category>
      <category>json</category>

      <description><![CDATA[
Streaming JSON formatter for Python that keeps nested payloads compact and readable through smart folding and packing.
]]></description>

<content:encoded><![CDATA[
<p>
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.
</p>

<p>
Example output:
</p>

<pre>{
  "meta": { "version": 1, "ok": true },
  "ids": [ 1, 2, 3, 4 ],
  "matrix": [ [1, 2], [3, 4] ]
}</pre>

<p>
The article also discusses streaming formatting, bounded buffering, width-aware layout decisions, and incremental processing without reparsing the full JSON tree.
</p>

<p>
Source code:
<a href="https://github.com/yairlenga/jsonfold/tree/main/python">
github.com/yairlenga/jsonfold
</a>
</p>

]]>
</content:encoded>

    </item>

  </channel>

</rss>