dlt.common.configuration.accessors
_Accessor Objects
class _Accessor(abc.ABC)
values
@contextmanager
def values(values: Mapping[str, Any]) -> Iterator[None]
Temporarily sets config values for the duration of the context, restoring the previous state on exit.
Values are written to the same provider as dlt.config[key] = value (config.toml for
dlt.config, secrets.toml for dlt.secrets) and are removed or reset to their previous
values when the context exits. Use it to apply overrides for a bounded scope without
permanently mutating the process-wide config.
Arguments:
valuesMapping[str, Any] - A mapping of dotted config keys (e.g.load.raise_on_failed_jobs) to the values to set for the duration of the context.
Yields:
None
register_provider
@staticmethod
def register_provider(provider: ConfigProvider) -> None
Registers provider to participate in the configuration resolution. provider
is added after all existing providers and will be used if all others do not resolve.
_ConfigAccessor Objects
class _ConfigAccessor(_Accessor)
Provides direct access to configured values that are not secrets.
config_providers
@property
def config_providers() -> Sequence[ConfigProvider]
Return a list of config providers, in lookup order
writable_provider
@property
def writable_provider() -> ConfigProvider
find first writable provider that does not support secrets - should be config.toml
value
A placeholder that tells dlt to replace it with actual config value during the call to a source or resource decorated function.
_SecretsAccessor Objects
class _SecretsAccessor(_Accessor)
Provides direct access to secrets.
config_providers
@property
def config_providers() -> Sequence[ConfigProvider]
Return a list of config providers that can hold secrets, in lookup order
writable_provider
@property
def writable_provider() -> ConfigProvider
find first writable provider that supports secrets - should be secrets.toml
value
A placeholder that tells dlt to replace it with actual secret during the call to a source or resource decorated function.
config
Dictionary-like access to all config values to dlt
secrets
Dictionary-like access to all secrets known known to dlt