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 details)
Built Distribution
File details
Details for the file env-tools-2.2.0.tar.gz
.
File metadata
- Download URL: env-tools-2.2.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 036e2b14218e71be921ec6328bc057d202fa42f25ee96d95ab15d1912014fd41 |
|
MD5 | 715b60e3072d57364102a5241a44ad68 |
|
BLAKE2b-256 | a6068345f1b7a77493765c0b4e8412702e5e25b8bfff814bd71b09e745819da2 |
File details
Details for the file env_tools-2.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: env_tools-2.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fc368c6bed89c53dc00ef80b7742cf4510d572f4a7bd5f6f481d859e5ac6a9c |
|
MD5 | a0aa7df64aa915dc0e2ec143f6f0f915 |
|
BLAKE2b-256 | 795367e613977b140a9ca0bcbcfd11a487c3575217ce882af237c0a8f1c9159f |