{"id":6650,"date":"2019-10-16T22:35:47","date_gmt":"2019-10-16T20:35:47","guid":{"rendered":"https:\/\/michlstechblog.info\/blog\/?p=6650"},"modified":"2019-10-17T12:44:01","modified_gmt":"2019-10-17T10:44:01","slug":"json-formatting-a-json-readable","status":"publish","type":"post","link":"https:\/\/michlstechblog.info\/blog\/json-formatting-a-json-readable\/","title":{"rendered":"JSON: Formatting a Json readable"},"content":{"rendered":"<div class=\"twoclick_social_bookmarks_post_6650 social_share_privacy clearfix 1.6.4 locale-en_US sprite-en_US\"><\/div><div class=\"twoclick-js\"><script type=\"text\/javascript\">\/* <![CDATA[ *\/\njQuery(document).ready(function($){if($('.twoclick_social_bookmarks_post_6650')){$('.twoclick_social_bookmarks_post_6650').socialSharePrivacy({\"services\":{\"flattr\":{\"uid\":\"Michl\",\"status\":\"on\",\"the_title\":\"JSON%3A%20Formatting%20a%20Json%20readable\",\"the_excerpt\":\"Hi%2C%0D%0A%0D%0Aif%20you%20have%20a%20unformated%20json%20expression%20like%0D%0A%5Bcode%5D%0D%0A%7B%26quot%3BMetallica%26quot%3B%3A%20%26quot%3BThrash%26quot%3B%2C%20%26quot%3BGraveDigger%26quot%3B%3A%20%26quot%3BPower%26quot%3B%2C%26quot%3BKataklsym%26quot%3B%3A%26quot%3BDeath%26quot%3B%7D%0D%0A%5B%2Fcode%5D%0D%0Aand%20want%20to%20format%20it%20readable%20you%20could%20use%20the%20python%20module%20json.tool%0D%0A%20%28more%26hellip%3B%29\",\"txt_info\":\"2 clicks for more data protection:\\r\\n\\r\\nOnly when you click here, the button will be come active and you can send your recommendation to Flattr. When activating, data are transmitted to third parties. \",\"perma_option\":\"off\"}},\"txt_help\":\"When you activate these fields by clicking, information to Flattr may be transferred abroad, and probably may also stored there.\",\"settings_perma\":\"Enable permanently and accept data transmission. \",\"info_link\":\"http:\\\/\\\/www.heise.de\\\/ct\\\/artikel\\\/2-Klicks-fuer-mehr-Datenschutz-1333879.html\",\"uri\":\"https:\\\/\\\/michlstechblog.info\\\/blog\\\/json-formatting-a-json-readable\\\/\",\"post_id\":6650,\"post_title_referrer_track\":\"JSON%3A+Formatting+a+Json+readable\",\"display_infobox\":\"on\"});}});\n\/* ]]> *\/<\/script><\/div><p>Hi,<\/p>\n<p>if you have a unformated json expression like<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n{&quot;Metallica&quot;: &quot;Thrash&quot;, &quot;GraveDigger&quot;: &quot;Power&quot;,&quot;Kataklsym&quot;:&quot;Death&quot;}\r\n<\/pre>\n<p>and want to format it readable you could use the <strong>python <\/strong>module <strong>json.tool<\/strong><br \/>\n<!--more--><br \/>\nUsage is quite simple:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmichael@debdev ~ # echo '{&quot;Metallica&quot;: &quot;Thrash&quot;, &quot;GraveDigger&quot;: &quot;Power&quot;,&quot;Kataklsym&quot;:&quot;Death&quot;}' | python -m json.tool\r\n{\r\n    &quot;GraveDigger&quot;: &quot;Power&quot;,\r\n    &quot;Kataklsym&quot;: &quot;Death&quot;,\r\n    &quot;Metallica&quot;: &quot;Thrash&quot;\r\n}\r\n<\/pre>\n<p>Or from a file <\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nmichael@debdev ~ # cat myFile.json | python -m json.tool\r\n{\r\n    &quot;GraveDigger&quot;: &quot;Power&quot;,\r\n    &quot;Kataklsym&quot;: &quot;Death&quot;,\r\n    &quot;Metallica&quot;: &quot;Thrash&quot;\r\n}\r\n<\/pre>\n<p>Michael<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, if you have a unformated json expression like {&quot;Metallica&quot;: &quot;Thrash&quot;, &quot;GraveDigger&quot;: &quot;Power&quot;,&quot;Kataklsym&quot;:&quot;Death&quot;} and want to format it readable you could use the python module json.tool<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[1380,1381],"class_list":["post-6650","post","type-post","status-publish","format-standard","hentry","category-scripting","tag-format","tag-json"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/comments?post=6650"}],"version-history":[{"count":2,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6650\/revisions"}],"predecessor-version":[{"id":6654,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/posts\/6650\/revisions\/6654"}],"wp:attachment":[{"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/media?parent=6650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/categories?post=6650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michlstechblog.info\/blog\/wp-json\/wp\/v2\/tags?post=6650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}