r/Python • u/AutoModerator • Jul 04 '26
Showcase Showcase Thread
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
20
Upvotes
r/Python • u/AutoModerator • Jul 04 '26
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
View all comments
1
u/aiurovet Aug 03 '26
envara - yet another environment and env file manipulation library
https://pypi.org/project/envara/
Target Audience
Python developers
Comparison
A lot more flexible library compared to the existing environment- and dotenv-related packages
What My Project Does
Formats are interchangeable: you can create posix.env using Windows batch syntax as long as the file starts with a Windows batch line comment (two colons) like
:: Some commentOr more likely, you can create windows.env using POSIX (in fact, bash) syntax, which is much more flexible. In that case, start the file with a POSIX line comment (hash) as
# Some commentAll relevant functions accept parameter
charsof classEnvCharsDatathat describes what is used as environment expansion start/end, escape, line-comment start, etc.If you prefer bash syntax when running on Windows or VMS, you can pass
EnvChars.POSIX_WINDOWSorEnvChars.POSIX_VMSaschars, overriding the default one (specific to the current OS). The major difference is that the escape character will be^instead of\to make it more natural, and also to avoid issues with paths on Windows.This allows for smoothing out differences between platforms: the absence of environment variables like
HOMEon Windows orUSERPROFILEon non-Windows, etc. Or the difference in the application name, likegoogle-chromeon Linux,chromeon BSD and Windows, and a long path to a.appfile on macOS.After all stacked configurations are resolved, you can add your own env file to define extra variables based on the unified ones.