Parse and Dump JSON
PythonRound-trip JSON with the json stdlib module.
import json
raw = '{"name":"chris","tags":["python","django"]}'
data = json.loads(raw)
data['tags'].append('fastapi')
print(json.dumps(data, indent=2))
Round-trip JSON with the json stdlib module.
import json
raw = '{"name":"chris","tags":["python","django"]}'
data = json.loads(raw)
data['tags'].append('fastapi')
print(json.dumps(data, indent=2))