- Improve error messages when loading fails
- Remove support for Python 3.8
- Remove support for Python < 3.8
()can now load object attributes, such as static methods (e.g.(): module.MyClass.generate)
!extcan now load object attributes, such as enum members (e.g.!ext module.MyEnum.MY_VALUE)
- Fixed loading
!importor!cfgtags in a!cfgtag
- Added a
logging_config_pathkeyword parameter toconfigue.loadto set up a logging configuration while loading a configuration file
- Loading a null
!pathwill now returnNoneinstead of raising an Exception
- The
!envtag has been removed, environment variables can now be loaded anywhere - The
cfg://syntax has been replaced with!cfg path.to.value !cfgnow redirects to a path in the current file (instead of the first loaded file)- Use
!importto load a path in another file
- Use
- The
ext://module.submodule.objectsyntax has been replaced with!ext module.submodule.object - Replaced
load_config_from_filewith aconfigue.loadfunction, which is now the main entrypoint of the library- use
configue.load("/path/to/file.yml")to load a file - use
configue.load("/path/to/file.yml", "path.to.section")to load only a section of a file - loading a path in a file recursively loads all children (replaced the lazy-loading with path loading), see README for more details
- use
- Removed the
load_config_from_dictfunction - The
!listtag has been removed, set your environment variable to[value_1, value_2]instead
- Remove all
!envtags - Remove all
!listtags, and replace your environment variables fromvalue1,value2to[value1,value2] - Replace
ext://path.to.loadwith!ext path.to.load - If you are using
!importto import a file containing values withcfg://path.to.load, replace thecfg://...with!import:path/to/root/file.yml path.to.load - Replace
cfg://path.to.loadwith!cfg path.to.load - Replace
configue.load_config_from_file(...)withconfigue.load(...) - Replace
configue.load_config_from_file(...)["path"]["to"]["load"]withconfigue.load(..., "path.to.load")
- The
!importtag can now specify the path to load in the other file, with the syntax:!import:path.to.load path/to/file.yml - Dictionaries and lists are now JSON dumpable and picklable
- Removed warning about missing environment variables from unloaded paths
- Added Python 3.10 support
- Updated PyYAML dependency version
- Added Python 3.9 support
- Fixed DeprecationWarning on collections import
- Fixed key errors when loading
cfg://paths from file
- Fixed top-level object loading
- Fixed PyPI package description
- Renamed into
configue - Removed json loading
- Updated dependency:
pyyamlto5.1
- Fixed warnings for missing environment variables appearing when a default was set
- Added a warning log when an environment variable is missing
- Using
**kwargs,.items()or.values()with a dictionary created with theConfigLoadernow converts the value
- An error log has been added when a class instantiation fails
!pathand!importnow work as expected when used after importing a file from another folder
~paths are correctly expanded when used with!pathin yaml files
- Emojis are now supported in yaml files
- Environment variables can now contain lists in YAML files, use
!list ${my_var}to create a python list when loading the file.
- Environment variables can now be inserted in
!pathvalues - Values that contain environment variables are now cast into strings, booleans, ints or floats
- You can use
!importto concatenate files
- Multiple environment variables can now be inserted in the same value
- Removed escaped callable syntax
\()
- Fixed a bug where tuples where not converted on access
- Fixed a bug that prevented accessing objects properties with
cfg://
- Added environment variables templating with
${var_name-default}when loading from YAML files - Added path completion with
!path folder/my_file.txtwhen loading from YAML files (prepends the absolute path to the folder containing the configuration file)
load_config_from_jsonhas been deprecated in favor ofload_config_from_yamlload_config_from_filehas been deprecated when using JSON files (use YAML files instead)
- Added callable list support
- Added
\()special value to escape callable key
- Added
load_config_from_file,load_config_from_dict,load_config_from_yaml_file,load_config_from_json_filemethods - Added
ConfigLoaderobject