Skip to main content

Tools for using .env files in Python

Project description

A simple module for loading and applying .env files.

Works in Python 2 and Python 3.

Running tests

$ py.test

Or, with tox (test with multiple Python versions):

$ tox

Example

.env

VARIABLE_A=123
VARIABLE_B="testing, testing"

example.py

import os

from env_tools import apply_env

# loads '.env' by default, to load another file use
# apply_env(load_env('filename'))
apply_env()

assert os.environ['VARIABLE_A'] == '123'
assert os.environ['VARIABLE_B'] == 'testing, testing'

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

env-tools-2.0.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

env_tools-2.0.0-py2.py3-none-any.whl (3.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file env-tools-2.0.0.tar.gz.

File metadata

  • Download URL: env-tools-2.0.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for env-tools-2.0.0.tar.gz
Algorithm Hash digest
SHA256 94c20ec4a2444adc4ec97aaded4f4b8d1310420734b508dd32b22fe3f4f16f24
MD5 147d06baa3e83fc92e0f949fcde7baf6
BLAKE2b-256 6cb7024f5f6d6963c015e711afd8104c86dc56e987c029b82c34ea70cb989e23

See more details on using hashes here.

File details

Details for the file env_tools-2.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for env_tools-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 95312cbe1a39e9951f06075a75bd15587b5c15768e500123cdf8ace5c22a660b
MD5 c96665b53171cd5bc42c69f3bd756884
BLAKE2b-256 b660974696c2910eca8ef0f8aeb74b8cb6c3aa7546dd48a0a9845fa1f26d7481

See more details on using hashes here.

Supported by

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