You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project, which uses pydantic-settings to gather a bunch of different settings. Very useful, very neat solution (getting rid of environment variables being imported everywhere is awesome. In addition, it provides an excellent way of documenting environment variables needed to run the project).
Some of my settings are read from a .env file, and I believed I could get rid of a load_dotenv() call in my code.
However, a dependency of my project also needs some of my settings, and expects them as an environment variable!
My feature request: could the SettingsConfigDict get a boolean to toggle whether if providing a .env file, the variables in the .env file get consumed (current behavior), or in addition get provided as environment variables (like what load_dotenv() does?) Or would you judge this too much of an edge case to add another setting to the dict?
Keep up the great work, there are not many days spent coding nowadays where I do not either touch a normal pydantic class or a pydantic-settings object!
The text was updated successfully, but these errors were encountered:
@gwdekker
Here is my understanding of this feature request. you need a flag to read the env variables from a dotenv file and set them as env variables for other projects. this is really an edge case and I would say it would be good to you implement it in your own project.
My use case is the following.
I have a project, which uses pydantic-settings to gather a bunch of different settings. Very useful, very neat solution (getting rid of environment variables being imported everywhere is awesome. In addition, it provides an excellent way of documenting environment variables needed to run the project).
Some of my settings are read from a .env file, and I believed I could get rid of a load_dotenv() call in my code.
However, a dependency of my project also needs some of my settings, and expects them as an environment variable!
My feature request: could the SettingsConfigDict get a boolean to toggle whether if providing a .env file, the variables in the .env file get consumed (current behavior), or in addition get provided as environment variables (like what load_dotenv() does?) Or would you judge this too much of an edge case to add another setting to the dict?
Keep up the great work, there are not many days spent coding nowadays where I do not either touch a normal pydantic class or a pydantic-settings object!
The text was updated successfully, but these errors were encountered: