common.configuration.providers.toml
SettingsTomlProvider Objects
class SettingsTomlProvider(CustomLoaderDocProvider)
__init__
def __init__(name: str, supports_secrets: bool, file_name: str,
resolvable_dirs: List[str]) -> None
Creates config provider from a toml
file
The provider loads the toml
file with specified name and from specified folder. If global_dir
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 toml file under settings_dir
is not found it will look into Google Colab userdata object for a value
with name file_name
and load toml file from it.
If that one is not found, it will try to load Streamlit secrets.toml
file.
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 loadresolvable_dirs
List[str] - A list of directories to resolve the file from, files will be merged into each other in the order the directories are specified. Provider is writeable if only one dir specified.
Raises:
TomlProviderReadException
- File could not be read, most probablytoml
parsing error