Easy application configuration with yaml files
Easyconfig simplifies the configuration management for (small) applications.
Validation and parsing of the configuration file is done through pydantic and easyconfig builds on that. It's possible to use all pydantic features and model features so every exotic use case should be covered. If you have previously worked with pydantic you should feel right at home
The documentation can be found at here
- Default
.yml
file generation - Environment variable expansion
- Support for docker secrets
- Callbacks when values of the configuration change
A pydantic settings object is a non-mutable object. With easyconfig you can create a global configuration and just import it into your modules. When your application starts you can read the configuration e.g. from a settings file and the object values will change the values accordingly.
Additionally, easyconfig can create a default configuration file with the specified default values and comments of the pydantic models. That way the users can have some guidance how to change the program behaviour.
It's possible to use environment variable or files for expansion. Easyconfig will load all values
- Updated CI and code linters
- Updated dependencies and code linters
- Breaking: requires pydantic 2.0
- Added support for variable expansion through environment variables and docker secrets
- Fix for StrictBool
- Fixed default generation for data types that inherit from python base types
- Fixed an issue where the default yaml file would not be created properly when using aliases in container
- Marked package as PEP 561 compatible (py.typed)
- Default values get validated, too
- Added extra kwargs check for pydantic fields
- Added option to get generated yaml as a string
- Added convenience base classes
AppBaseModel
andBaseModel
- Works with private attributes and class functions
- Fixed an issue where multiline comments would not be created properly
- Added an option to exclude entries from config file
- Allow callbacks for file defaults
- Switched to new and more flexible API
- File default and config default are now separated
- Comments get nicely intended
- Fixed an issue with nested data structures
- Allow to specify a different value for file creation
- Fixed an issue with dynamic defaults
- Optional values with default None will not be created in the yaml file
- Updated requirements
- Validate user defaults
- Use json representation of values to get native yaml data types
- Use enum values instead of enum types
- Initial release