common.configuration.providers.toml
SettingsTomlProvider Objects
class SettingsTomlProvider(CustomLoaderDocProvider)
__init__
def __init__(name: str,
supports_secrets: bool,
file_name: str,
settings_dir: str = None,
add_global_config: bool = False) -> None
Creates config provider from a toml
file
The provider loads the toml
file with specified name and from specified folder. If add_global_config
flags is specified,
it will additionally look for file_name
in dlt
global dir (home dir by default) and merge the content.
The "settings" (settings_dir
) values overwrite the "global" values.
If none of the files exist, an empty provider is created.
Arguments:
name(str)
- name of the provider when registering in contextsupports_secrets(bool)
- allows to store secret values in this providerfile_name
str - The name oftoml
file to loadsettings_dir
str, optional - The location offile_name
. If not specified, defaults to $cwd/.dltadd_global_config
bool, optional - Looks forfile_name
indlt
home directory which in most cases is $HOME/.dlt
Raises:
TomlProviderReadException
- File could not be read, most probablytoml
parsing error