parse_json()
Contents
parse_json()¶
Parse serialized JSON data from a string.
Examples¶

1 2 3 4 5 6 | serialized_json = '{"red":255, "green":255, "blue":128}'
def setup():
data = py5.parse_json(serialized_json)
py5.fill(data['red'], data['green'], data['blue'])
py5.rect(10, 10, 80, 80)
|
Description¶
Parse serialized JSON data from a string. When reading JSON data from a file, load_json() is the better choice.
The JSON data is parsed using the Python json library with the loads
method, and the kwargs
parameter is passed along to that method.
Syntax¶
parse_json(serialized_json: Any, **kwargs: dict[str, Any]) -> Any
Parameters¶
kwargs: dict[str, Any] - keyword arguments
serialized_json: Any - JSON data object that has been serialized as a string
Updated on March 01, 2022 12:15:01pm UTC