Python Bytes: JSON Tutorial

Published: 12 July 2021
on channel: CyberScribe.org
303
2

In this video I talk about working with JSON in Python.


Json Docs:
https://www.json.org/json-en.html

Python Json Docs:
https://docs.python.org/3/library/jso...

The JSON library is used to Serialize and Deserialized JSON object to/from Python dictionaries.

Serialize - convert / change into a format that can be stored and reconstructed later.

JSON is part of the Python standard libarary, just 'import json'.

Deserialize (convert to Python-usable structure, dict))
json.load(file containing json document) # load single Json document from file
json.loads(string) # load a string containing a json document (either from a file or other variable)

Serialize (convert to Json)
json.dump(python object, file object) # write a python dict to a file, serialized as json
json.dumps(python object) # dump a python dictionary to a json object, formatted as a string

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


On this page of the site you can watch the video online Python Bytes: JSON Tutorial with a duration of online in good quality, which was uploaded by the user CyberScribe.org 12 July 2021, share the link with friends and acquaintances, this video has already been watched 303 times on youtube and it was liked by 2 viewers. Enjoy your viewing!