Skip to main content

input_as_python_instance

No overview available.

def input_as_python_instance(
input_value: any,
target_type: type
) - > object

Converts a raw input value into a Python object instance based on a specified type hint or class.

Parameters

NameTypeDescription
input_valueanyThe raw data to be converted, typically a dictionary or primitive type.
target_typetypeThe Python class or type hint that defines the structure and type of the resulting instance.

Returns

TypeDescription
objectAn instance of the specified type, populated with the provided input data.