Skip to main content

Like the dotenv-flow NodeJS library, for Python

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dotenv_flow-0.4.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dotenv_flow-0.4.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file dotenv_flow-0.4.0.tar.gz.

File metadata

  • Download URL: dotenv_flow-0.4.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.9 Linux/6.1.14-200.fc37.x86_64

File hashes

Hashes for dotenv_flow-0.4.0.tar.gz
Algorithm Hash digest
SHA256 54f85cb67028d78d51543436d5270a919bf6d9ef37d737c9ef333f70f8f4f352
MD5 2a62aaa85b06110a2bc3b45b140d712e
BLAKE2b-256 50693e01533f8de00c4e554abfd226085cdf0f2b0fca7a68fafa2e52cc3f7175

See more details on using hashes here.

File details

Details for the file dotenv_flow-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: dotenv_flow-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.0 CPython/3.10.9 Linux/6.1.14-200.fc37.x86_64

File hashes

Hashes for dotenv_flow-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b9a4a6bf81b081ab7d9a7a6523a09f5bfd640288325bda7050d7d08da82b692
MD5 75813ec4d050b219d8b32b086832eba7
BLAKE2b-256 0f87c1c2e0416717380fd4f147b991a3e2daf74b0d5ba959344018713fc8499d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page