Tools for using .env files in Python
Project description
env-tools
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.4.0.tar.gz
(2.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file env_tools-2.4.0.tar.gz.
File metadata
- Download URL: env_tools-2.4.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5979fb0486d428e0659865335385990f9776f27b05346dcdcfbd290ab9ff9b4a
|
|
| MD5 |
c375e7a2a2ce28f3071591bc45bff7a5
|
|
| BLAKE2b-256 |
fcfe6e1f798aad787e15105c61236bf3f201a1408a2bf067d6962545e5c2f974
|
File details
Details for the file env_tools-2.4.0-py2.py3-none-any.whl.
File metadata
- Download URL: env_tools-2.4.0-py2.py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a927635eef0fa32ff33e89b244519b3e924227ba372d46f6f32629faf5c404f
|
|
| MD5 |
92f581327102a5abc2838626b9ec72fc
|
|
| BLAKE2b-256 |
80d28c9b21a7c8e8195105baef25f5f50bdfd41dbae318004244939484485d73
|