Sources¶
- class confz.ConfZFileSource¶
Bases:
confz.confz_source.ConfZSource
Source config for files.
- file: Optional[pathlib.Path] = None¶
Specify a config file directly by a path.
- file_from_cl: Optional[Union[int, str]] = None¶
Alternatively, use this command line argument to get the file name/path. It can be a specific position (integer, e.g. 1) or after a specific option (string, e.g. --config-file). In the latter case, the file name must follow after whitespace, an equal sign between argument and value is not supported at the moment.
- folder: Optional[pathlib.Path] = None¶
The file specified above can optionally be relative to this folder.
- format: Optional[confz.confz_source.FileFormat] = None¶
The format of the config file. If not specified, it will be inferred from the file ending.
- class confz.ConfZEnvSource¶
Bases:
confz.confz_source.ConfZSource
Source config for environment variables. Environment variable names are transformed to lowercase and all dashes are replaced by underscores. The definitions below are not case-sensitive and can be written with underscore or dash. An exception is prefix, which needs to match exactly. Dot-notation can be used to access nested configurations.
- deny: Optional[List[str]] = None¶
Do not allow to read from environemnt variables in this list. Useful if allow_all is set and certain variables should be excluded.
- class confz.ConfZCLArgSource¶
Bases:
confz.confz_source.ConfZSource
Source config for command line arguments. Command line arguments are case-sensitive. Dot-notation can be used to access nested configurations. Only command line arguments starting with two dashes (--) are considered. Between argument and value must be whitespace, an equal sign is not supported at the moment.
- class confz.ConfZDataSource¶
Bases:
confz.confz_source.ConfZSource
Source config for raw data, i.e. constants. This can be useful for unit-test together with
change_config_sources()
to inject test data into the config.
- confz.ConfZSources¶
alias of
Union
[confz.confz_source.ConfZSource
,List
[confz.confz_source.ConfZSource
]]