Skip to main content

Dotenv handler for Python

Project description

Build status Coverage status MIT license PyPI package version PyPI python version

Dotenv handler for Python

usages

Installing

pip install dotenvy

Common usage as library

from dotenvy import load_env, read_file
from os import environ

load_env(read_file('.env'))
my_var = environ.get('MY_VAR')

Loading dotenv file to a dict with type casting

from dotenvy import read_file, truthy

config = read_file('.env', schema={
  'HOSTNAME': str,
  'PORT': int,
  'IS_DEBUG': bool,  # either [1/true/on/yes] or [0/false/off/no]
})

Using it as a CLI tool

# default dotenv file is '.env'
dotenvy ./mywebapp run

# using alternate dotenv file
dotenvy --file=prod.env ./mywebapp run

development

Checking codestyle

./setup.py stylecheck

Running tests

./setup.py test

Running tests on all supported python versions

pip install tox
tox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for dotenvy, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size dotenvy-0.2.0-py2.py3-none-any.whl (6.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size dotenvy-0.2.0.tar.gz (4.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page