<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>json on semikolan</title>
    <link>https://semikolan.me/tags/json/</link>
    <description>Recent content in json on semikolan</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Mon, 27 Jul 2026 21:19:11 +0530</lastBuildDate>
    <atom:link href="https://semikolan.me/tags/json/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Pretty-print JSON in one shell pipe</title>
      <link>https://semikolan.me/til/pretty-print-json/</link>
      <pubDate>Sat, 18 Jul 2026 00:00:00 +0000</pubDate>
      <guid>https://semikolan.me/til/pretty-print-json/</guid>
      <description>&lt;p&gt;When you just want to &lt;em&gt;read&lt;/em&gt; an API response and don&amp;rsquo;t feel like installing anything:&lt;/p&gt;&#xA;&lt;figure class=&#34;code term&#34;&gt;&#xA;  &lt;figcaption class=&#34;term-bar&#34;&gt;&lt;span class=&#34;dots&#34; aria-hidden=&#34;true&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;term-title&#34;&gt;bash&lt;/span&gt;&lt;/figcaption&gt;&#xA;  &lt;div class=&#34;chroma&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl -s https://api.example.com/thing &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; python -m json.tool&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/figure&gt;&lt;p&gt;&lt;code&gt;python -m json.tool&lt;/code&gt; ships with every Python install and pretty-prints stdin. No &lt;code&gt;jq&lt;/code&gt;, no dependencies. Here&amp;rsquo;s the whole thing, command and output:&lt;/p&gt;&#xA;&lt;figure class=&#34;code term&#34;&gt;&#xA;  &lt;figcaption class=&#34;term-bar&#34;&gt;&lt;span class=&#34;dots&#34; aria-hidden=&#34;true&#34;&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;term-title&#34;&gt;bash&lt;/span&gt;&lt;/figcaption&gt;&#xA;  &lt;div class=&#34;chroma&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-console&#34; data-lang=&#34;console&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gp&#34;&gt;$&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;{&amp;#34;name&amp;#34;:&amp;#34;ada&amp;#34;,&amp;#34;langs&amp;#34;:[&amp;#34;go&amp;#34;,&amp;#34;rust&amp;#34;]}&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; python -m json.tool&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;go&#34;&gt;{&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;go&#34;&gt;    &amp;#34;name&amp;#34;: &amp;#34;ada&amp;#34;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;go&#34;&gt;    &amp;#34;langs&amp;#34;: [&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;go&#34;&gt;        &amp;#34;go&amp;#34;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;go&#34;&gt;        &amp;#34;rust&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;go&#34;&gt;    ]&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;go&#34;&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&#xA;&lt;/figure&gt;&lt;p&gt;For anything more than eyeballing — filtering, reshaping — reach for &lt;code&gt;jq&lt;/code&gt;. For a quick look, this is already on your machine.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
