-
Notifications
You must be signed in to change notification settings - Fork 30
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
[request] allow for environment variables in config #32
Comments
Any update on this? I also need to use env vars in the config file. |
Sorry, this one hasn't been a priority for me. PR's welcome, but I will start working on it when I get a chance! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would like to include environment variables in the config.ini file. I often find myself adding a bunch of long filepaths or complicated variables that might change in the future, so this would be really convenient for me.
For example:
I already have an idea of how you could accomplish this. Basically, you could just subclass BasicInterpolation and just expand the variables before the value is accessed:
And then you would just initialize the config parser as:
parser = configparser.ConfigParser(interpolation=EnvInterpolation())
You could even subclass ExtendedInterpolation if you want the user to access variables from other sections (although the interpolation syntax is a bit different). I would really appreciate if you did this.
The text was updated successfully, but these errors were encountered: