It can get tedious to type all those command line arguments every time. Fix it by creating a configuration file:
Specify the config file by passing a
config_path parameter to the
The location of the
config_path is relative to your Python file.
config.yaml is loaded automatically when you run your application
You can override values in the loaded config from the command line:
Strict mode is useful for catching mistakes in both the command line overrides and in the code early.
Strict mode is on by default when you specify a configuration file for the
config_path argument in
It can be turned on or off via the
strict argument in your
Strict mode will also catch command line override mistakes:
With strict mode off, accessing unknown keys in the config is permitted and both the above override and the example below would run.