skip to navigation
skip to content

env-tools 2.1.0

Tools for using .env files in Python

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'
 
File Type Py Version Uploaded on Size
env-tools-2.1.0.tar.gz (md5) Source 2017-07-14 2KB
env_tools-2.1.0-py2.py3-none-any.whl (md5) Python Wheel 3.6 2017-07-14 3KB