Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.14.0 - 2025-08-16
Added
- Support for Python 3.13
Removed
- Support for Python 3.6, 3.7, and 3.8
0.13.1 - 2023-11-05
Fixed
- README formatting of "stringify" section.
0.13.0 - 2023-11-05
Added
- Support for Python 3.9, 3.10, 3.11, and 3.12. The way
pathlib.Pathwas being subclassed was causing issues in newer Python versions anddistutils.util.strtoboolhas been removed in newer Python versions so a backported version is now being used.
Changed
- Extra
tomlandyamldependencies have been updated. - The
tomlextra now installstomlkitversion0.7.2on Python 3.6 and constrained to^0.12.2on Python 3.7 and greater. Previously, it was constrained to^0.6.0. -
The
yamlextra now installsruamel.yamlconstrained to^0.17.16. Previously, it was constrained to^0.16.10. -
Replaced deprecated use of
ruamel.yamlmethods in the YAML parser (via #28, thanks @JaWeRn).
Removed
- Deprecated
stringify()method onConfigFile. Usestr()on theConfigFileinstead.
0.12.0 - 2020-10-03
Added
- Python's built-in
inkeyword now works with a ConfigFile.
Example:
```python config = ConfigFile('./pyproject.toml')
'tool.poetry' in config
True ```
Changed
- Depreciated
stringify()in favor of just using the built-instr().
Fixed
- Addresses issue #25 (INI parser isn't converting back to string).
0.11.0 - 2020-08-07
Added
-
ConfigFilecan now accept yaml and toml files as optional extra file types. As long as the extras (yamlandtoml) are installed, those file types can also be used. -
ConfigFilecan now be indexed into using an array notation to get, set, and delete keys. -
pathproperty toConfigFile -
original_pathproperty toConfigFile -
wildoptional argument tohasonConfigFileto check if the file has an occurrence of the key anywhere in the file.
Removed
-
BaseParserfrom the public API. -
parseroptional argument from theConfigFileconstructor.
Changed
-
pathon theConfigFileis now a property that can only be retrieved.contentsis now private but you can use.stringify()instead to get the contents.parseris now also private. -
restore_originalinConfigFilenow raises aFileNotFoundErrorinstead of anOSErrorif the original file path does not exist. -
restore_original's optional argument is now calledoriginal_pathrather thanoriginal_file_path.
Fixed
defaultinConfigFile'sgetmethod can now beNone. Previously, it was defaulted to the valueNoneso there was no way of distinguishing between the default value and a user inputted value ofNone.
0.10.0 - 2020-05-10
Changed
-
tomlandpyyamlare now optional extra dependencies. This allows you to not have to install them if you aren't using them. -
retrieve_allinJsonParser'sgetmethod is now calledget_allfor consistency. It isn't publicly available yet. The thought is to write a custom ini parser first that supports multiple of the same keys and subsections. This way you can have theget_all,set_all,delete_all, etc. methods for all file type parsers. I would have to weight if that added complexity of not using the built-in configparser and roll our own for some added features is worth it or see if there are ways to work around it with configparser that are ideal.
Fixed
- You can now specify a default and still coerce your return type. Previously, if you specified a default, there was no logic in that branch to coerce your return type as well.
0.9.0 - 2020-02-09
Added
-
defaultoptional parameter to theget()method ofConfigFile. The allows a default value to be fallen back to if the given key is missing. -
return_typeoptional parameter toget()method ofConfigFile. This allows you to coerce the return type to one of your choosing by feeding it the return value.
Changed
-
Automatic type parsing is now off by default. This is because of the addition of the
return_typeoptional parameter. After using the package more, I think the explicitness of specifying the type you're after or that you'd like to automatically parse the type to one of the basic types is more maintainable. However, I think the option to automatically parse or parse a whole section of values is still a useful one. -
The
parse_typeparameter toConfigFile'sget()method is now calledparse_types.
0.8.0 - 2020-02-02
Added
- More type hints to
ConfigFileandIniParser. nested_lookupdependency to help with modifying deeply nested structures (JSON + YAML)JsonParserso you can now specify.jsonfiles to be parsed.
Changed
- The original content of the passed in file is now called
contentinstead ofcontents. This is for consistency since the parsed version is calledparsed_content.
0.7.0 - 2020-01-27
Fixed
- Support for using custom parsers with
ConfigFilewith theparseroptional argument. This was technically supported before, but it was not tested and found to not actually use the passed in parser once tested.
Changed
- The
reset()method onConfigFileis now calledrestore_original(). The behavior is the same. This was done to better describe what exactly that method is doing. Since the file is not written back out with everyset()ordelete()and callingsave()explicitly is required,reset()may have been confused with resetting the changes you've made rather than deleting and restoring the original configuration file.
0.6.0 - 2020-01-24
Changed
- Bumped down python version requirement to 3.6 and now test 3.6, 3.7, and 3.8 on CI.
0.5.0 - 2020-01-19
Added
- Support for retrieving entire sections as a
dictwithget().
0.4.0 - 2020-01-19
Added
-
reset()andsave()methods toConfigFile. This allows you to reset your configuration file to an "original state," given the original config file path. However, say you have aconfig/config.jsonfile. Then it will automatically try to look forconfig/config.original.jsonif no file path is specified. Thesave()method should be called after your changes to the config file. It will write them back out. -
Raise test coverage to 93%.
0.3.3 - 2020-01-18
Changed
_split_on_dotis no longer in base parser (now in a utils file). Also, the default behavior is now to split on every dot and split on only the last dot if specified
Fixed
-
ConfigFilewas trying to use_split_on_dot, but it no longer inherited from base parser. -
TypeErrorwhen setting the key/value pairs since configparser requires the option to be a string. The parser now just converts the value to a string if it is not one and then adds the key/value pair. It would still be parsed correctly when retrieving it.
0.3.1 - 2020-01-17
Fixed
isinstancecall forBaseParserto be correctly used.
0.3.0 - 2020-01-17
Added
-
Abstract base parser as a contract for concrete file format parser implementations.
-
Exposed
ConfigFile,BaseParser, andParsingErrorto the Public API. The base parser is exposed to allow future custom extensions of the config file and what it can parse by its users. -
has_sectionandhas_keyis now changed to a singlehasmethod which determines whether you're checking a section or key by the presence of a dot. -
IniParserto support the ini format. It uses configparser internally, but it is only exposed through theConfigFileobject.
0.2.0 - 2020-01-04
Added
- Parsing of strings to their native values
0.1.0 - 2020-01-04
- Initial Release