Skip to main content

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

env_tools-2.4.0-py2.py3-none-any.whl (2.7 kB view details)

Uploaded Python 2Python 3

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

Hashes for env_tools-2.4.0.tar.gz
Algorithm Hash digest
SHA256 5979fb0486d428e0659865335385990f9776f27b05346dcdcfbd290ab9ff9b4a
MD5 c375e7a2a2ce28f3071591bc45bff7a5
BLAKE2b-256 fcfe6e1f798aad787e15105c61236bf3f201a1408a2bf067d6962545e5c2f974

See more details on using hashes here.

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

Hashes for env_tools-2.4.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3a927635eef0fa32ff33e89b244519b3e924227ba372d46f6f32629faf5c404f
MD5 92f581327102a5abc2838626b9ec72fc
BLAKE2b-256 80d28c9b21a7c8e8195105baef25f5f50bdfd41dbae318004244939484485d73

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page