{"id":4850,"date":"2025-01-27T12:53:36","date_gmt":"2025-01-27T12:53:36","guid":{"rendered":"https:\/\/ibex.tech\/python\/?p=4850"},"modified":"2025-01-27T12:53:37","modified_gmt":"2025-01-27T12:53:37","slug":"convert-dictionary-to-json","status":"publish","type":"post","link":"https:\/\/ibex.tech\/python\/json\/convert-dictionary-to-json","title":{"rendered":"Convert dictionary to JSON"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Dictionary to JSON<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>    #Create a dictionary you want to output as JSON\n    my_dictionary = {  \n        \"value1\": 3,  \n        \"value2\": \"abc\",  \n        \"nested_values\": {\n            \"value_a\": \"hello\",\n            \"value_b\": \"world\"\n        },\n        \"value3\": \"def\"\n        }\n        \n    #Convert Python dictionary to JSON  \n    my_json_string = json.dumps(my_dictionary, indent = 4) \n\n    #View the JSON object\n    print(my_json_string)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Dictionary to JSON<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[380],"tags":[],"class_list":["post-4850","post","type-post","status-publish","format-standard","hentry","category-json"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/comments?post=4850"}],"version-history":[{"count":1,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4850\/revisions"}],"predecessor-version":[{"id":4851,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/posts\/4850\/revisions\/4851"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/media?parent=4850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/categories?post=4850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/python\/wp-json\/wp\/v2\/tags?post=4850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}