core.converters
Contains custom converters.
Attributes
Classes
This is a |
Functions
Decodes a date string HTML5 (RFC3339) compliant. |
|
|
Encodes a date HTML5 (RFC3339) compliant. |
|
Decodes a json string to a dict. |
|
Encodes a dictionary to json. |
|
Turns a uuid string into a UUID instance. |
|
Turns a UUID instance into a uuid string. |
|
|
|
Decodes a boolean. |
|
Encodes a boolean. |
|
|
Decodes a datetime. |
|
|
Encodes a datetime. |
|
|
|
|
|
|
Module Contents
- core.converters.extended_date_decode(s: Literal['']) None [source]
- core.converters.extended_date_decode(s: str) datetime.date
Decodes a date string HTML5 (RFC3339) compliant.
- core.converters.extended_date_encode(d: datetime.date | None) str [source]
Encodes a date HTML5 (RFC3339) compliant.
- core.converters.json_decode(s: Literal['']) None [source]
- core.converters.json_decode(s: str) dict[str, Any]
Decodes a json string to a dict.
- core.converters.json_encode(d: Mapping[str, Any] | None) str [source]
Encodes a dictionary to json.
- core.converters.uuid_decode(s: str) uuid.UUID | None [source]
Turns a uuid string into a UUID instance.
- core.converters.uuid_encode(uuid: uuid.UUID | str | None) str [source]
Turns a UUID instance into a uuid string.
- core.converters.bool_decode(s: Literal['0', '']) Literal[False] [source]
- core.converters.bool_decode(s: Literal['1']) Literal[True]
- core.converters.bool_decode(s: str) bool
Decodes a boolean.
- core.converters.bool_encode(d: Literal[False] | None) Literal['0'] [source]
- core.converters.bool_encode(d: Literal[True]) Literal['1']
- core.converters.bool_encode(d: bool | None) Literal['0', '1']
Encodes a boolean.
- core.converters.datetime_decode(s: Literal['']) None [source]
- core.converters.datetime_decode(s: str) datetime.datetime
Decodes a datetime.
- core.converters.move_direction_decode(s: str) onegov.core.orm.abstract.MoveDirection | None [source]
- core.converters.move_direction_encode(d: str | onegov.core.orm.abstract.MoveDirection | None) str [source]
- core.converters.get_default_move_direction_converter() morepath.Converter[MoveDirection] [source]
- class core.converters.LiteralConverter(literal_type: Any, /)[source]
- class core.converters.LiteralConverter(*literals: LiteralString)
Bases:
LiteralConverterBase
This is a
Converter
counter-part totyping.Literal
.