Read JSON file using Python
The full-form of JSON is JavaScript Object Notation. It means that a script (executable) file which is made of text in a programming language, is used to store and transfer the data. Python supports JSON through a built-in package called json. To use this feature, we import the json package in Python script. The text in JSON is done through quoted-string which contains the value in key-value mapping within { }.
Reading From JSON
Itâs pretty easy to load a JSON object in Python. Python has a built-in package called json, which can be used to work with JSON data. Itâs done by using the JSON module, which provides us with a lot of methods which among loads() and load() methods are gonna help us to read the JSON file.
Deserialization of JSON
The Deserialization of JSON means the conversion of JSON objects into their respective Python objects. The load()/loads() method is used for it. If you have used JSON data from another program or obtained as a string format of JSON, then it can easily be deserialized with load()/loads(), which is usually used to load from string, otherwise, the root object is in list or dict. See the following table given below.
| JSON OBJECT | PYTHON OBJECT |
|---|---|
| object | dict |
| array | list |
| string | str |
| null | None |
| number (int) | int |
| number (real) | float |
| true | True |
| false | False |








