json
Classes:
-
JsonSerializer–A serializer for JSON data.
-
JsonStreamSerializer–A serializer for JSON data.
Attributes:
-
JSON_TYPES–The types that can be serialized to JSON.
-
json_serializer–JsonSerializer with default settings.
-
json_stream_serializer–JsonStreamSerializer with default settings.
JSON_TYPES
module-attribute
The types that can be serialized to JSON.
json_serializer
module-attribute
json_serializer = JsonSerializer()
JsonSerializer with default settings.
json_stream_serializer
module-attribute
json_stream_serializer = JsonStreamSerializer()
JsonStreamSerializer with default settings.
JsonSerializer
JsonSerializer(
encoder: JSONEncoder = DEFAULT_JSON_ENCODER,
decoder: JSONDecoder = DEFAULT_JSON_DECODER,
)
Bases: Serializer[JsonType], _JsonSerializerBase
A serializer for JSON data.
Methods:
-
deserialize_config–Deserialize the configuration from a JSON string.
-
deserialize_data–Deserialize the given JSON data.
-
serialize_config–Serialize the configuration to a JSON string.
-
serialize_data–Serialize the given value to JSON.
deserialize_config
deserialize_config(config: str) -> C
Deserialize the configuration from a JSON string.
deserialize_data
deserialize_data(content: SerializedData) -> JsonType
Deserialize the given JSON data.
JsonStreamSerializer
JsonStreamSerializer(
encoder: JSONEncoder = DEFAULT_JSON_ENCODER,
decoder: JSONDecoder = DEFAULT_JSON_DECODER,
)
Bases: StreamSerializer[JsonType], _JsonSerializerBase
A serializer for JSON data.
Methods:
-
deserialize_config–Deserialize the configuration from a JSON string.
-
deserialize_data_stream–Deserialize the given stream of JSON data.
-
serialize_config–Serialize the configuration to a JSON string.
-
serialize_data_stream–Serialize the given stream of JSON data.
deserialize_config
deserialize_config(config: str) -> C
Deserialize the configuration from a JSON string.
deserialize_data_stream
deserialize_data_stream(
content: SerializedDataStream,
) -> AsyncGenerator[JsonType]
Deserialize the given stream of JSON data.
serialize_data_stream
serialize_data_stream(
stream: AsyncIterable[JsonType],
) -> SerializedDataStream
Serialize the given stream of JSON data.