Need to manage a config file to pass run parameters into an application? Check out this new packaged, released in June 2025. I have been using this code for 3 years and finally decided to package it and make it available through PYPI.
The doc explains (I hope) how the package works, but it will create a config file on the first run of the application and then read the existing file if it exists. The end user can set the parameters in the config file as needed.
The values maintained in the config file are defined in a python module called config.py. Python types of string, integer, float, list and boolean are supported natively. There are several hooks that all you to provide custom edits or to convert a section or variable to a dictionary. As the application is modified, there is a version number in the config.py module which when changed, forces the rebuilding of the config file with the new changes, maintaining the existing settings and config defined comments.
Finally, all the values from the config file are imported into a python module which can then be passed between application modules through the import mechanism. I like import src.config as cfg and then I can reference all the variables as cfg.mylist.
Check out https://pypi.org/project/app-config to see if it simplifies your application config file implementation.