For writing a JSON file in a good manner way, you can use json.load():
Below is the piece of code that can be used with a JSON file:-
with open('filename.txt', 'r') as handle:
parsed = json.load(handle)
Another way you can follow, you can use the following command:-
python3 -m json.tool < some.json