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.2.0.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for env_tools-2.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fc368c6bed89c53dc00ef80b7742cf4510d572f4a7bd5f6f481d859e5ac6a9c |
|
MD5 | a0aa7df64aa915dc0e2ec143f6f0f915 |
|
BLAKE2b-256 | 795367e613977b140a9ca0bcbcfd11a487c3575217ce882af237c0a8f1c9159f |