Just to demonstrate what you can do using Python json module.
sampleObj = { "car1": { "name":"Ford", "price":35000}, "car2": { "name":"BMW", "price":65000} } str = json.dumps(sampleObj, indent=4) print(str)use the json.dumps()