Python package for handling user-provided options with flexible defaults, documentation and checking
OptionsFactory allows you to define a set of options, which can have (if you like): default values (which may be expressions depending on other options); documentation for each option; an allowed type or list of types; a check that the value option is on an allowed list; checks that the value of an option satisfies some tests. Once the options are defined in an OptionsFactory, you create a particular instance of the options by passing some user settings (a dict or YAML file). The OptionsFactory uses the values passed, sets the remaining options from the default values or expressions and returns an Options object. Options are immutable so that you do not have to worry about the options being accidentally changed during execution - however, the package also provides MutableOptionsFactory if you do want to be able to update the options dynamically.