The json module helps with from python objects to json encoded strings and back
Dumps the given python object into a json encoded string
(note: this function is also available under the alias ‘encode’)
obj (object) – the python object to encode
str
an encoded string with the contents of the python object
Loads the given JSON encoded string into a python object
The function will throw an error if the string is not valid json
(note: this function is also available under the alias ‘decode’)
s (str) – the string to decode
object
the decoded string s as a python object