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.1.0.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

env_tools-2.1.0-py2.py3-none-any.whl (3.6 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for env-tools-2.1.0.tar.gz
Algorithm Hash digest
SHA256 4afbc1869699f84a6eed6a73660bf662d48866f51ef64560baab3d4f9e3e0a01
MD5 a0654527c212d86c03932a33788f9d61
BLAKE2b-256 ce7f785a0789ea281655a610d530983e95714a5dbe0b43e1a1417e264b7c392b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for env_tools-2.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 99f3f62615c3826c192c49113292f227d65cea30db463743ad0f6a756fc15c8a
MD5 bf7cb4dc2c4b5e6da7008661581f81a1
BLAKE2b-256 eb73e99375701eeb9cc9de5bd80507c2b14affb7be5f19c9506f7ca057616cb6

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