{"id":17713,"date":"2020-06-01T06:15:50","date_gmt":"2020-06-01T13:15:50","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=17713"},"modified":"2023-12-01T03:05:30","modified_gmt":"2023-12-01T11:05:30","slug":"python-json","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-json\/","title":{"rendered":"Python JSON"},"content":{"rendered":"\n<p>JSON is a popular data format used for storing structured data.<br><\/p>\n\n\n\n<p>When you\u2019re building an application in Python, you may decide that you want to use JSON in your app. For instance, you may want to read data from a JSON file, or write data stored in the JSON format to a file.<br><\/p>\n\n\n\n<p>In this guide, we\u2019re going to break down the basics of the JSON data format, how to use the Python json module, and how to work with JSON in Python. By the end of reading this tutorial, you\u2019ll be an expert at using JSON in your Python programs!<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is JSON?<\/h2>\n\n\n\n<p>JSON, which is short for JavaScript Object Notation, is a data format that allows you to store structured data.<br><\/p>\n\n\n\n<p>Often, JSON is used to send data to and from a server in a web application. You may have seen, for instance, that many APIs such as the Fitbit API, or the Google Maps API return data in the JSON format<br><\/p>\n\n\n\n<p>This is because JSON data is standardized, structured, and easy to read.<br><\/p>\n\n\n\n<p>Here is an example of a JSON record in Python:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{\n\t\"name\": \"James Smith\",\n\t\"id\": 202,\n\t\"probation\": False\n}\n<\/pre><\/div>\n\n\n\n<p>This record stores three keys, which are on the left side of the colons (:), and three values, which are stored on the right side of the colons. Each key is bound to a value.<br><\/p>\n\n\n\n<p>The JSON data format should not be confused with a dictionary. While this may look just like a dictionary, JSON is a data format, whereas a dictionary is a data structure.<br><\/p>\n\n\n\n<p>This means that, if you want to store your JSON data in a dictionary, you will need to convert it to a dictionary; if you want to store a dictionary as JSON, you\u2019ll need to convert it to JSON.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Import json in Python<\/h2>\n\n\n\n<p>Before you start working with JSON objects in Python, you\u2019ll need to import the Python json module. This module includes a number of functions that allow you to work with JSON data.<br><\/p>\n\n\n\n<p>To import the JSON module, you can use this statement:<br><\/p>\n\n\n\n<p><code>import json<br><\/code><\/p>\n\n\n\n<p>Now that we\u2019ve imported the JSON module into your code, we can start working with its functions.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Parse JSON in Python<\/h2>\n\n\n\n<p>One of the most important functions you\u2019ll need to perform when it comes to working with JSON data is parsing JSON into a dictionary.<br><\/p>\n\n\n\n<p>To parse JSON into a dictionary, you can use the <code>json.loads() <\/code>method.<br><\/p>\n\n\n\n<p><code>json.loads()<\/code> accepts one parameter: the JSON string you want to convert to a dictionary.<br><\/p>\n\n\n\n<p>Suppose you have a JSON string that stores information about the projects a coder is assigned to on an engineering team. You want to convert that JSON string into a dictionary. To do so, you could use this code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import json\nemployee = \"{'name': 'Linda Richardson', 'projects': ['Directory', 'Homepage']}\"\nemployee_dictionary = json.loads(employee)\nprint(employee_dictionary)\nprint(employee_dictionary[\"name\"])\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p>{&#8216;name&#8217;: &#8216;Linda Richardson&#8217;, &#8216;projects&#8217;: [&#8216;Directory&#8217;, &#8216;Homepage&#8217;]}<\/p>\n\n\n\n<p>Linda Richardson<br><\/p>\n\n\n\n<p>Let\u2019s break down our code. First, we import the json module into our code. Then, we declare a string called <code>employee<\/code> which stores our employee record in a JSON structure.<br><\/p>\n\n\n\n<p>Next, we use <code>json.loads()<\/code> to convert our <code>employee<\/code> string to JSON. Then, we print our new dictionary to the console. We also print the value of the <code>name<\/code> key to the console.<br><\/p>\n\n\n\n<p>As you can see, our dictionary looks the same as our JSON string. But, now our data is stored as a dictionary. We can tell because, when we print out the value of the \u201cname\u201d key, \u201cLinda Richardson\u201d is printed to the console.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Convert Dictionary to JSON String<\/h2>\n\n\n\n<p>When you\u2019re working with a dictionary, you may want to convert it into a JSON string.<br><\/p>\n\n\n\n<p>This is a common operation because, because you save a JSON value to a file, it needs to be formatted as a string. To convert a dictionary to JSON, we can use the <code>json.dumps()<\/code> method.<br><\/p>\n\n\n\n<p>Suppose we want to convert a dictionary with information about an employee to a JSON string. We could do so using this code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import json\nemployee = {\n\t\"name\": \"Linda Richardson\",\n\t\"id\": 107,\n\t\"probation\": False,\n\t\"department\": \"Sales\"\n}\nemployee_json = json.dumps(employee)\nprint(employee_json)\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p>\u2018{&#8220;name&#8221;: &#8220;Linda Richardson&#8221;, &#8220;id&#8221;: 107, &#8220;probation&#8221;: false, &#8220;department&#8221;: &#8220;Sales&#8221;}\u2019<br><\/p>\n\n\n\n<p>While the output of our code may look just like our original dictionary, our dictionary is now stored as a string.&nbsp;<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Formatting a JSON String<\/h2>\n\n\n\n<p>The <code>json.dumps()<\/code> method comes with a few parameters that you can use to make it easier to read the final string created by the method.<br><\/p>\n\n\n\n<p>The <code>indent<\/code> parameter allows you to define the number of indents that appear in the final JSON string. Suppose you want to add four indents to each line on your JSON string. You could do so using the following <code>json.dumps()<\/code> statement:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>employee_json = json.dumps(employee, indent=4)\n<\/pre><\/div>\n\n\n\n<p>This statement, when combined with our last example, would return:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{\n    \"name\": \"Linda Richardson\",\n    \"id\": 107,\n    \"probation\": false,\n    \"department\": \"Sales\"\n}\n<\/pre><\/div>\n\n\n\n<p>You can also change the separators of the data in the JSON string. The default values for the separators are \u201c, \u201d and \u201c: \u201d, which means that every object will be separated using a comma, and every key and value will be separated using a colon.<br><\/p>\n\n\n\n<p>Suppose we want our keys and values to be separated using an equals sign (=), and we want to use an indent of 4. We could do so using this statement:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>employee_json = json.dumps(employee, indent=4, separators=(\", \", \" = \"))\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{\n    \"name\" = \"Linda Richardson\", \n    \"id\" = 107, \n    \"probation\" = false, \n    \"department\" = \"Sales\"\n}\n<\/pre><\/div>\n\n\n\n<p>As you can see, every key and value in our JSON string is now separated using an equals sign.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Read a JSON File<\/h2>\n\n\n\n<p>To read a JSON file in Python, you can use <code>json.load()<\/code>. This method accepts one parameter: the file object that you want to read in your program.<br><\/p>\n\n\n\n<p>Suppose we have a file called employee.json that we want to load into our program. The contents of this file are as follows:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{\"name\": \"Linda Richardson\", \"id\": 107, \"probation\": false}\n<\/pre><\/div>\n\n\n\n<p>We could do so using this code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>{\"name\": \"Linda Richardson\", \"id\": 107, \"probation\": false}\nWe could do so using this code:\nimport json\nwith open('employee.json') as final_file:\n\temployee = json.load(final_file)\nprint(employee)\n<\/pre><\/div>\n\n\n\n<p>Our code returns:<br><\/p>\n\n\n\n<p>{&#8220;name&#8221;: &#8220;Linda Richardson&#8221;, &#8220;id&#8221;: 107, &#8220;probation&#8221;: false}<br><\/p>\n\n\n\n<p>In this code, we first import the json library. Then, we use a <code>with<\/code> statement to read our <code>employee.json<\/code> file. We use the <code>json.load() <\/code>method to convert the contents of our file, stored in the <code>file<\/code> variable, to a dictionary. Then, we print out the value of our dictionary.<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Write JSON to a File<\/h2>\n\n\n\n<p>You can use the <code>json.dump()<\/code> method to write JSON to a file in Python.<br><\/p>\n\n\n\n<p>The <code>json.dump()<\/code> method accepts two parameters: the dictionary you want to write to a file, and the file object that you want to write your dictionary.<br><\/p>\n\n\n\n<p>Suppose we want to save our employee\u2019s record as a JSON value in a file. The name of this file should be <code>linda_employee.json<\/code>. We could do so using the following code:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>import json\nemployee = {\n\t\"name\": \"Linda Richardson\",\n\t\"id\": 107,\n\t\"probation\": False,\n\t\"department\": \"Sales\"\n}\nwith open('linda_employee.json', 'w') as final_file:\n\tjson.dump(employee, final_file)\n<\/pre><\/div>\n\n\n\n<p>Let\u2019s break down our code. First, we import the json module into our program. Then, we declare a variable which stores information about an employee called Linda Richardson in a dictionary structure.<br><\/p>\n\n\n\n<p>Next, we use a \u201cwith\u201d statement with the \u201cw\u201d flag to prepare a file called <code>linda_employee.json<\/code> to which we can write. We then use <code>json.dump() <\/code>to convert our <code>employee<\/code> dictionary to a JSON string and to save it to our <code>final_file<\/code> object.<br><\/p>\n\n\n\n<p>When this program is run, the contents of our <code>employee<\/code> dictionary are written to the <code>linda_employee.json<\/code> file. The final contents of this file are:<br><\/p>\n\n\n\n<p><code>{\"name\": \"Linda Richardson\", \"id\": 107, \"probation\": false, \"department\": \"Sales\"}<br><\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>The Python json module allows you to read and manipulate JSON data.<br><\/p>\n\n\n\n<p>Using the json module, you can:<br><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Read JSON from a file<\/li>\n\n\n\n<li>Convert a dictionary to JSON<\/li>\n\n\n\n<li>Convert JSON to a dictionary<\/li>\n\n\n\n<li>Write a JSON string to a file<\/li>\n<\/ul>\n\n\n\n<p>In this tutorial, we explored how to perform all these operations using the json module. Now you\u2019re ready to start working with JSON data in Python like a professional!<\/p>\n\n\n\n<p><br><strong><em>Are you interested in learning how to code in Python? Download the <\/em><\/strong><a href=\"https:\/\/careerkarma.com\/\"><strong><em>free Career Karma app<\/em><\/strong><\/a><strong><em> today to unlock top learning resources and to discover training programs that can help you master Python.<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"JSON is a popular data format used for storing structured data. When you\u2019re building an application in Python, you may decide that you want to use JSON in your app. For instance, you may want to read data from a JSON file, or write data stored in the JSON format to a file. In this&hellip;","protected":false},"author":240,"featured_media":17716,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-17713","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Python","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":"","is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python JSON: A Complete Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"The Python json module allows you to work with JSON data in a program. On Career Karma, learn how to use the Python json module.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/python-json\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python JSON\" \/>\n<meta property=\"og:description\" content=\"The Python json module allows you to work with JSON data in a program. On Career Karma, learn how to use the Python json module.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-json\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-01T13:15:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:05:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"900\" \/>\n\t<meta property=\"og:image:height\" content=\"592\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python JSON\",\"datePublished\":\"2020-06-01T13:15:50+00:00\",\"dateModified\":\"2023-12-01T11:05:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/\"},\"wordCount\":1235,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-json\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-json\/\",\"name\":\"Python JSON: A Complete Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg\",\"datePublished\":\"2020-06-01T13:15:50+00:00\",\"dateModified\":\"2023-12-01T11:05:30+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"The Python json module allows you to work with JSON data in a program. On Career Karma, learn how to use the Python json module.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-json\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg\",\"width\":900,\"height\":592},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-json\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/careerkarma.com\/blog\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python JSON\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python JSON: A Complete Guide | Career Karma","description":"The Python json module allows you to work with JSON data in a program. On Career Karma, learn how to use the Python json module.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/careerkarma.com\/blog\/python-json\/","og_locale":"en_US","og_type":"article","og_title":"Python JSON","og_description":"The Python json module allows you to work with JSON data in a program. On Career Karma, learn how to use the Python json module.","og_url":"https:\/\/careerkarma.com\/blog\/python-json\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-06-01T13:15:50+00:00","article_modified_time":"2023-12-01T11:05:30+00:00","og_image":[{"width":900,"height":592,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-json\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-json\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python JSON","datePublished":"2020-06-01T13:15:50+00:00","dateModified":"2023-12-01T11:05:30+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-json\/"},"wordCount":1235,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-json\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-json\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-json\/","url":"https:\/\/careerkarma.com\/blog\/python-json\/","name":"Python JSON: A Complete Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-json\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-json\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg","datePublished":"2020-06-01T13:15:50+00:00","dateModified":"2023-12-01T11:05:30+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"The Python json module allows you to work with JSON data in a program. On Career Karma, learn how to use the Python json module.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-json\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-json\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-json\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/06\/fabian-grohs-dsOvZnqGawg-unsplash.jpg","width":900,"height":592},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-json\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/careerkarma.com\/blog\/python\/"},{"@type":"ListItem","position":3,"name":"Python JSON"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/17713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=17713"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/17713\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/17716"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=17713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=17713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=17713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}