aiq.utils.io.yaml_tools#
Attributes#
Functions#
|
Interpolate variables in a string with the format ${VAR:-default_value}. |
|
Load a YAML file and interpolate variables in the format |
|
Load a YAML string and interpolate variables in the format |
|
Dump a configuration dictionary to a YAML file. |
|
Dump a configuration dictionary to a YAML string. |
Module Contents#
- logger#
- _interpolate_variables( ) str | int | float | bool | None #
Interpolate variables in a string with the format ${VAR:-default_value}. If the variable is not set, the default value will be used. If no default value is provided, an empty string will be used.
- Args:
value (str | int | float | bool | None): The value to interpolate variables in.
- Returns:
str | int | float | bool | None: The value with variables interpolated.
- yaml_load(config_path: aiq.utils.type_utils.StrPath) dict #
Load a YAML file and interpolate variables in the format ${VAR:-default_value}.
- Args:
config_path (StrPath): The path to the YAML file to load.
- Returns:
dict: The processed configuration dictionary.
- yaml_loads(config: str) dict #
Load a YAML string and interpolate variables in the format ${VAR:-default_value}.
- Args:
config (str): The YAML string to load.
- Returns:
dict: The processed configuration dictionary.