Skip to main content

from_json

Deserialize JSON data to a Python object.

def from_json(
data: str | bytes | bytearray,
allow_inf_nan: bool = True,
cache_strings: bool | Literal['all', 'keys', 'none'] = True,
allow_partial: bool | Literal['off', 'on', 'trailing-strings'] = False
) - > Any

Deserialize JSON data to a Python object. This is effectively a faster version of json.loads(), with some extra functionality.

Parameters

NameTypeDescription
data`strbytes
allow_inf_nanbool = TrueWhether to allow Infinity, -Infinity and NaN values as json.loads() does by default.
cache_strings`boolLiteral['all', 'keys', 'none']` = True
allow_partial`boolLiteral['off', 'on', 'trailing-strings']` = False

Returns

TypeDescription
AnyThe deserialized Python object.