-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move user configuration to programming language agnostic file format #20
Comments
I like the general idea. My thoughts on the first implementation were, that I do not have to do excessive validation, if the config stays in a python file. I am open to moving it to a seperate file, which would definitly increase user-friendliness. While JSON is lightweight, I'd prefer YAML or INI as they allow comments which could increase user-friendliness even more. Reducing the necessity to search for everything in the documentation. I like to stay with the standardlib of python wherever I can, which would give INI a headstart. I think that it would be nice, if the program automatically selects default settings for the selected country, which requires some settings to be commented out by default. If we want to stay with JSON, we could do something like |
I like your proposal for using YAML because of its support of comments. Also, the default configuration value totally makes sense, I saw that you used such a default country configuration for Germany. Might submit a new PR. Could I get your preference, where we want to parse it - leave it in |
I think it's cleaner in its own file as a Config class. Just sharing config = Config() with other files. The class should validate the input. I'll leave it to you how the class is saving the config. Eitherbas dict or flat. I am not sure what fits the purpose better. |
https://docs.python.org/3/library/configparser.html could be a perfect fit for that |
Currently, the configuration is done by manipulating
src/config.py
which is loaded during Python module load. The user has to first navigate into thesrc
directory and additionally manipulate a Python language code file, this is prone to errors.However, the configuration can be moved to a file in the project root, and could be represented in a broad known file format, like JSON or INI. Subsequently, the configuration file format is easier to exchange for later usage.
Possible first approach would be a JSON which is read in during
src/main.py
:Please provide different suggestions for the file format.
The text was updated successfully, but these errors were encountered: