Python Json Module: Reference and Examples

Last updated:

WIP Alert This is a work in progress. Current information is correct but more content will probably be added in the future.

json.loads

Reads a valid json string into a variable

json.dumps

Prints dictionaries, lists and primitive types as arrays

decoding python values to json values and vice versa

Clas JSONDecoderperforms the following conversions by default:

JSON Python
object dict
array list
string str
number (int) int
number (real) float
true True
false False
null None

See also

Dialogue & Discussion