You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

dotenv-flow

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dotenv-flow

Like the dotenv-flow NodeJS library, for Python

0.4.0
pipPyPI
Maintainers
1

dotenv_flow

Hierarchically load different dotenv files based on the value of the PY_ENV variable. Dotenv files will be searched by name, by decreasing order of priority (specificity) to the selected environment.

As dotenv files are loaded, the process' environment (os.environ) is enriched with the variables found in those files. Environment values that already exist will be left untouched.

Files have 2 flavors:

  • public (ex: .env.dev) that should be committed to version control
  • private (ex: .env.dev.local) that has preference over the previous one if present, and should NOT

This is the python version of Node's dotenv-flow.

dotenv files are loaded with python-dotenv

This should be added to version control ignore file:

# local .env* files
.env.local
.env.*.local

It's probably a good idea to also ignore plain .env files, as most tools will warn you that it's a potential security risk. Instead, including a .env-example seems to be a popular way to document the environment variables in use.

Keywords

environment variables

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts