Skip to content

Module: reference_resolver

Module to resolve references in a dictionary.

ReferenceResolver

Class to resolve references in a dictionary.

Parameters:

Name Type Description Default
variables Dict[str, BaseType]

The dictionary to resolve the references in.

required

resolve()

Resolve the references in the dictionary.

Returns:

Type Description
Dict[str, BaseType]

The dictionary with the references resolved.

resolve_element(element)

Resolve an element in a dictionary.

Parameters:

Name Type Description Default
element BaseType

The element to resolve.

required

Returns:

Type Description
BaseType

The resolved element.

get_variable(variables, key_path, default=None)

Get variable from dictionary by key.

Parameters:

Name Type Description Default
variables Dict[str, BaseType]

The dictionary to search for the key.

required
key_path str

The key path to search for in the dictionary. The key path is a string with keys separated by dots.

required
default Any

The default value to return if the key is not found.

None

Returns:

Type Description
BaseType

The value of the key in the dictionary or the default value if the key is not found.