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
| Name | Type | Description |
|---|---|---|
| data | `str | bytes |
| allow_inf_nan | bool = True | Whether to allow Infinity, -Infinity and NaN values as json.loads() does by default. |
| cache_strings | `bool | Literal['all', 'keys', 'none']` = True |
| allow_partial | `bool | Literal['off', 'on', 'trailing-strings']` = False |
Returns
| Type | Description |
|---|---|
Any | The deserialized Python object. |