JSON data manipulation
Let's now look at how to use Python to manipulate JSON data. JSON (Java Script Object Notation) is a very widely used data storage and exchange format. It gained popularity as the internet matured, and it became the standard for information exchange in REST-based APIs or services.
Python provides us with a JSON module for JSON data manipulation. Let's create a JSON file called employees.json and look at how we can use the JSON module to access the JSON content. Let's say that our objective is to read the employees' data, then to find the employees whose salary is over 30,000, and mark them with slab A. We'll then mark those whose salary is less than 30,000 with slab B:
The obtained output is shown in the following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access