Skip to content

datetime

Classes:

Attributes:

iso8601_serializer module-attribute

iso8601_serializer = Iso8601Serializer()

Iso8601Serializer with default settings.

Iso8601Serializer

Bases: Serializer[datetime]

A serializer for JSON data.

Methods:

Attributes:

content_types class-attribute instance-attribute

content_types: tuple[str, ...] = ()

The content types that the serializer uses.

Used to get serializers by content type in the registry.

deserialize_config

deserialize_config(config: str) -> C

Deserialize the configuration from a JSON string.

deserialize_data

deserialize_data(content: SerializedData) -> datetime

Deserialize the given JSON data.

serialize_config

serialize_config(config: C) -> str

Serialize the configuration to a JSON string.

serialize_data

serialize_data(value: datetime) -> SerializedData

Serialize the given value to JSON.