Very simple:

import json
data = json.loads('{"one" : "1", "two" : "2", "three" : "3"}')
print(data['two'])  # or `print data['two']` in Python 2
Answer from John Giotta on Stack Overflow
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ json.html
json โ€” JSON encoder and decoder
3 weeks ago - Return the Python representation of s (a str instance containing a JSON document). JSONDecodeError will be raised if the given JSON document is not valid. ... Decode a JSON document from s (a str beginning with a JSON document) and return a 2-tuple of the Python representation and the index in s where the document ended...
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_json.asp
Python JSON
If you have a JSON string, you can parse it by using the json.loads() method. The result will be a Python dictionary.
๐ŸŒ
Bobdc
bobdc.com โ€บ blog โ€บ pythonjson
Parsing JSON with Python
December 15, 2024 - My sample demo data to parse is pretty close to the test input that I used when I wrote about JSON2RDF: { "mydata": { "color": "red", "amount": 3, "arrayTest": [ "north", "south", "east", "escaped \"test\" string", "west" ], "boolTest": true, "nullTest": null, "addressBookEntry": { "givenName": "Richard", "familyName": "Mutt", "address": { "street": "1 Main St", "city": "Springfield", "zip": "10045" } } } } ... #!/usr/bin/env python3 import json f = open('jsondemo.js') data = json.load(f) print(data["mydata"]["color"]) print(data["mydata"]["amount"]) # Pull something out of the middle of an ar
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ encoding-and-decoding-custom-objects-in-python-json
Encoding and Decoding Custom Objects in Python-JSON - GeeksforGeeks
January 24, 2026 - The object_hook parameter in json.loads() allows you to define how the JSON data is converted back into a Python object. By providing a custom object_hook function, you can control the deserialization process. ... import json # Custom decoder function def as_complex(dct): if '__complex__' in dct: return complex(dct['real'], dct['imag']) return dct # JSON string representing a complex number json_data = '{"__complex__": true, "real": 1, "imag": 2}' # Decoding using custom function com_num = json.loads(json_data, object_hook=as_complex) print(com_num) print(type(com_num))
๐ŸŒ
Zyte
zyte.com โ€บ home โ€บ blog โ€บ json parsing with python [practical guide]
JSON Parsing with Python [Practical Guide]
July 6, 2023 - One of the most common tasks when working with JSON data is to read its contents. Python provides several built-in libraries for reading JSON from files, APIs, and web applications. To read JSON data, you can use the built-in json module (JSON Encoder and Decoder) in Python.
Find elsewhere
๐ŸŒ
Medium
medium.com โ€บ dev-bits โ€บ a-simple-guide-to-json-in-python-simple-and-advanced-variations-ebe184e6bbe3
A simple guide to JSON in Python, simple and advanced variations | by Naren Yellavula | Dev bits | Medium
January 20, 2023 - Many different JSON data types have equivalent Python types and vice-versa. Next, letโ€™s see how to decode a JSON file (ex: data.json) instead of a string foo using load() method.
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ handling json files with ease in python
r/Python on Reddit: Handling JSON files with ease in Python
May 29, 2022 -

I have finished writing the third article in the Data Engineering with Python series. This is about working with JSON data in Python. I have tried to cover every necessary use case. If you have any other suggestions, let me know.

Working with JSON in Python
Data Engineering with Python series

๐ŸŒ
NetworkAcademy
networkacademy.io โ€บ learning path: ccna automation (200-901) ccnaauto โ€บ data formats and data models โ€บ parsing json with python
Parsing JSON with Python | NetworkAcademy.IO
Import JSON moduleTo work with JSON data (string or JSON file), first, it has to be 'translated' into the python data structure. In this lesson, we are going to use python's built-in module json to do it.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ how-to-use-the-json-module-in-python
How to Use the JSON Module in Python โ€“ A Beginner's Guide
June 5, 2023 - The JSON module in Python allows you to encode and decode custom objects by using JSON encoder and decoder classes.
๐ŸŒ
Medium
medium.com โ€บ @ayush-thakur02 โ€บ understanding-custom-encoders-and-decoders-in-pythons-json-module-1490d3d23cf7
Understanding Custom Encoders and Decoders in Pythonโ€™s JSON Module | by Ayush Thakur | Medium
November 16, 2023 - Using object_hook, you can define a function that will be called for each JSON object decoded from the JSON string or file. Inside the function, you can define the logic to convert JSON objects into custom Python objects.
๐ŸŒ
ScrapingBee
scrapingbee.com โ€บ blog โ€บ how-to-read-and-parse-json-data-with-python
How to read and parse JSON data with Python | ScrapingBee
January 17, 2026 - In this article, you learned how to encode and decode a JSON string to a Python object and vice versa. Moreover, you saw how a custom encoder can be used to encode custom types to JSON. The json package is very versatile and provides a ton of additional features that are worth exploring.
๐ŸŒ
Claudia Kuenzler
claudiokuenzler.com โ€บ blog โ€บ 1394 โ€บ how-to-handle-json-decode-error-python-script-try-except
How to handle JSON decode error in Python script with try and except
February 20, 2024 - However the error handler JSONDecodeError does not exist in the "global" namespace of the Python script and needs to be called from the json module: try: data = json.loads(output) except json.JSONDecodeError as e: print("Error: Unable to decode JSON, Error: {}. Manually run command ({}) to verify JSON output.".format(e, cmd))
๐ŸŒ
QuickType
quicktype.io
Convert JSON to Swift, C#, TypeScript, Objective-C, Go, Java, C++ and more
quicktype generates types and helper code for reading JSON in C#, Swift, JavaScript, Flow, Python, TypeScript, Go, Rust, Objective-C, Kotlin, C++ and more. Customize online with advanced options, or download a command-line tool.
๐ŸŒ
Bright Data
brightdata.com โ€บ blog โ€บ how-tos โ€บ parse-json-data-with-python
Guide to Parsing JSON Data With Python
September 16, 2025 - Through those two methods, json gives you the ability to convert JSON data to equivalent Python objects like dictionaries and lists, and vice versa. Plus, the json module allows you to create custom encoders and decoders to handle specific data types.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-jsondecoder-module
Python json.decoder Module - GeeksforGeeks
July 23, 2025 - JSONDecoder can be customized by overriding the default object_hook. This is a function that takes a dictionary and returns a dictionary. You can define your own conversions within this function.
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ gloss_python_json_parse.asp
Python JSON Parse
The result will be a Python dictionary. ... import json # some JSON: x = '{ "name":"John", "age":30, "city":"New York"}' # parse x: y = json.loads(x) # the result is a Python dictionary: print(y["age"]) Try it Yourself ยป
๐ŸŒ
Real Python
realpython.com โ€บ python-json
Working With JSON Data in Python โ€“ Real Python
August 20, 2025 - That means you can conveniently convert Python data types into JSON data and the other way around. The act of converting data into the JSON format is referred to as serialization. This process involves transforming data into a series of bytes for storage or transmission over a network. The opposite process, deserialization, involves decoding data from the JSON format back into a usable form within Python.