I have a JSON
file with the following details:
{
"Name":"TESTING",
"Place":"India",
"Path":"Road",
"Details":
[
{
"city":"",
"landmark":"aaabbbcccc",
"pin":"500001"
},
{
"city":"",
"landmark":"aaabbbcccc",
"pin":"500001"
},
{
"city":"",
"landmark":"xxxyyyzzzz",
"pin":"510009"
}
]
}
I want to parse the above json file and fetch the Name, Place, Path and store them into variables and then fetch city, landmark and pin and store them into arrays. How can i do this in Python. I've tried searching but all I could find is just reading the json file but not parsing it this way.
My Python code for reading the json:
import glob, os, json
from pprint import pprint
jsonfile = "testing.json"
with open('C:/Users/dev/Desktop/JSONSTest/'+jsonfile) as data_file:
data = json.load(data_file)
pprint(data)