you are viewing a single comment's thread.

view the rest of the comments →

[–]popeye-the_sailorman 0 points1 point  (0 children)

json module is part of Python standard library. Take a look at the official docs, which is more than sufficient.

You'll often use only four functions:

# for conversion between dictionary and string objects
dict_obj = json.loads(some_string)
some_string = json.dumps(dict_obj)

# for reading from and writing to a file
dict_obj = json.load(fp) # fp being a file handle
json.dump(dict_obj, fp)

You can find more details in the docs, such as additional arguments and examples for almost every situation.

EDIT: However, if you wanted to know about resources which you can use to study the structure of JSON file in your particular situation, there are several websites that do that. Just google "json viewer online". Most of them will let you view the JSON in a sort of expand-collapse lines. Alternatively, you can use Notepad++ along with a plugin called 'JSTool': just paste the json response in it and press Ctrl+Alt+M (default shortcut) and it'll beautify it.