module documentation

Base converter and implementations for data conversion.

Class AdvancedJSONEncoder Advanced JSON encoder.
Class BinaryNullPayloadConverter Converter for 'binary/null' payloads supporting None values.
Class BinaryPlainPayloadConverter Converter for 'binary/plain' payloads supporting bytes values.
Class BinaryProtoPayloadConverter Converter for 'binary/protobuf' payloads supporting protobuf Message values.
Class CompositePayloadConverter Composite payload converter that delegates to a list of encoding payload converters.
Class DataConverter Data converter for converting and encoding payloads to/from Python values.
Class DefaultFailureConverter Default failure converter.
Class DefaultFailureConverterWithEncodedAttributes Implementation of DefaultFailureConverter which moves message and stack trace to encoded attributes subject to a codec.
Class DefaultPayloadConverter Default payload converter compatible with other Temporal SDKs.
Class EncodingPayloadConverter Base converter to/from single payload/value with a known encoding for use in CompositePayloadConverter.
Class FailureConverter Base failure converter to/from errors.
Class JSONPlainPayloadConverter Converter for 'json/plain' payloads supporting common Python values.
Class JSONProtoPayloadConverter Converter for 'json/protobuf' payloads supporting protobuf Message values.
Class JSONTypeConverter Converter for converting an object from Python json.loads result (e.g. scalar, list, or dict) to a known type.
Class PayloadCodec Codec for encoding/decoding to/from bytes.
Class PayloadConverter Base payload converter to/from multiple payloads/values.
Function decode_search_attributes Decode API search attributes to values.
Function decode_typed_search_attributes Decode API search attributes to typed search attributes.
Function default Default data converter.
Function encode_search_attribute_values Convert search attribute values into a payload.
Function encode_search_attributes Convert search attributes into an API message.
Function encode_typed_search_attribute_value Convert typed search attribute value into a payload.
Function value_to_type Convert a given value to the given type hint.
Function _decode_search_attribute_value Undocumented
Function _encode_maybe_typed_search_attributes Undocumented
Function _get_iso_datetime_parser Isolates system version check and returns relevant datetime passer
Variable _JSONTypeConverterUnhandled Undocumented
Variable _sym_db Undocumented

Decode API search attributes to values.

Deprecated since version Use: typed search attributes instead.
Parameters
api:temporalio.api.common.v1.SearchAttributesAPI message with search attribute values to convert.
Returns
temporalio.common.SearchAttributesConverted search attribute values (new mapping every time).

Decode API search attributes to typed search attributes.

Parameters
api:temporalio.api.common.v1.SearchAttributesAPI message with search attribute values to convert.
Returns
temporalio.common.TypedSearchAttributesTyped search attribute collection (new object every time).
def default() -> DataConverter: (source)

Default data converter.

Deprecated since version Use: DataConverter.default instead.

Convert search attribute values into a payload.

Deprecated since version Use: typed search attributes instead.
Parameters
vals:temporalio.common.SearchAttributeValuesList of values to convert.
Returns
temporalio.api.common.v1.PayloadUndocumented

Convert search attributes into an API message.

Parameters
attributes:Union[temporalio.common.SearchAttributes, temporalio.common.TypedSearchAttributes]Search attributes to convert. The dictionary form of this is DEPRECATED.
api:temporalio.api.common.v1.SearchAttributesAPI message to set converted attributes on.
def value_to_type(hint: Type, value: Any, custom_converters: Sequence[JSONTypeConverter] = []) -> Any: (source)

Convert a given value to the given type hint.

This is used internally to convert a raw JSON loaded value to a specific type hint.

Parameters
hint:TypeType hint to convert the value to.
value:AnyRaw value (e.g. primitive, dict, or list) to convert from.
custom_converters:Sequence[JSONTypeConverter]Set of custom converters to try before doing default conversion. Converters are tried in order and the first value that is not JSONTypeConverter.Unhandled will be returned from this function instead of doing default behavior.
Returns
AnyConverted value.
Raises
TypeErrorUnable to convert to the given hint.

Undocumented

def _encode_maybe_typed_search_attributes(non_typed_attributes: Optional[temporalio.common.SearchAttributes], typed_attributes: Optional[temporalio.common.TypedSearchAttributes], api: temporalio.api.common.v1.SearchAttributes): (source)

Undocumented

def _get_iso_datetime_parser() -> Callable[[str], datetime]: (source)

Isolates system version check and returns relevant datetime passer

Returns
Callable[[str], datetime]A callable to parse date strings into datetimes.
_JSONTypeConverterUnhandled = (source)

Undocumented

Undocumented