jsonyx.loads¶
- jsonyx.loads(s, *, allow=NOTHING, cache_keys=False, filename='<string>', hooks=None)[source]¶
Deserialize a JSON string to a Python object.
Changed in version 2.0: Replaced
use_decimalwithhooks.Changed in version 2.2:
Added
cache_keys.Disabled caching keys by default.
- Parameters:
- Raises:
TruncatedSyntaxError – when failing to decode the string
- Returns:
Any– a Python object
- Example:
>>> import jsonyx as json >>> json.loads('{"foo": ["bar", null, 1.0, 2]}') {'foo': ['bar', None, 1.0, 2]} >>> json.loads(r'"\"foo\bar"') '"foo\x08ar'
Tip
Specify
filenameto display the filename in error messages.