syside.JsonReader
- class JsonReader
Unbound reader for JSON deserialization
Initialization
- bind(s: str) syside.JsonReader
Bind a serialized JSON string for reading.
Note that only one reader can be bound at a time, binding again will raise
ValueError
. Suggested usage is through a context manager:with reader.bind(json_str) as json: model, report = deserializer.accept(json, syside.DESERIALIZE_STANDARD)
- class StrReader
Bases:
syside.Reader
Bound reader for JSON deserialization that can be used together with
Deserializer
.Resource usage can be controlled through context manager.
- unbind() None
Unbind this reader explicitly, allowing resources to be reused for other reads.
Attempting to use this for deserialization again will raise
RuntimeError
.
- attribute_hint() syside.AttributeMap | None
Get a hint for deserialization attributes.
- __enter__() syside.JsonReader