a better dotenv–from the creator of dotenv.
- run anywhere (cross-platform)
- multi-environment
- encrypted envs
Install and use it in code just like python-dotenv.
pip install python-dotenvxThe wheel includes native dotenvx Rust primitives. No dotenvx executable or post-install download is required.
# main.pyimportosfromdotenvximportload_dotenvload_dotenv() # take environment variables from .envprint(os.getenv("S3_BUCKET"))You can also parse values without changing the environment:
fromdotenvximportdotenv_valuesvalues=dotenv_values(".env")Encrypted values are decrypted using DOTENV_PRIVATE_KEY from the environment
or a neighboring .env.keys file.
