yaml_utils
YAML Utilities for Camply
read_yaml(path=None)
#
Read a YAML File
Load a yaml configuration file_path (path) or data object (data) and resolve any environment variables. The environment variables must be in this format to be parsed: ${VAR_NAME}.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
Optional[str]
|
File Path of YAML Object to Read |
None
|
Examples:
database: host: ${HOST} port: ${PORT} ${KEY}: ${VALUE} app: log_path: "/var/${LOG_PATH}" something_else: "${AWESOME_ENV_VAR}/var/${A_SECOND_AWESOME_VAR}"
Source code in camply/utils/yaml_utils.py
yaml_file_to_arguments(file_path)
#
Convert YAML File into A Dictionary to be used as **kwargs
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_path |
str
|
File Path to YAML |
required |
Returns:
Type | Description |
---|---|
Tuple[str, Dict[str, object], Dict[str, object]]
|
Tuple containing provider string, provider kwargs, and search kwargs |