class flytekit.extend.TypeEngine(*args, **kwds)[source]

Core Extensible TypeEngine of Flytekit. This should be used to extend the capabilities of FlyteKits type system. Users can implement their own TypeTransformers and register them with the TypeEngine. This will allow special handling of user objects




dict_to_literal_map(ctx, d[, ...])

Given a dictionary mapping string keys to python values and a dictionary containing guessed types for such string keys, convert to a LiteralMap.


Returns all python types for which transformers are available


The TypeEngine hierarchy for flyteKit.


Transforms a flyte-specific LiteralType to a regular python value.


Transforms a dictionary of flyte-specific Variable objects to a dictionary of regular python values.

literal_map_to_kwargs(ctx, lm, python_types)

Given a LiteralMap (usually an input into a task - intermediate), convert to kwargs for the task


Converts a python-native NamedTuple to a flyte-specific VariableMap of named literals.

register(transformer[, additional_types])

This should be used for all types that respond with the right type annotation when you use type(...) function

register_restricted_type(name, type)

to_literal(ctx, python_val, python_type, ...)

Converts a python value of a given type and expected LiteralType into a resolved Literal value.


Converts a python type into a flyte specific LiteralType

to_python_value(ctx, lv, expected_python_type)

Converts a Literal value with an expected python type into a python value.