Skip to main content
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

Release files for dotenvy 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dotenvy 0.2.0
File Size Uploaded
dotenvy-0.2.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dotenvy 0.2.0
File Interpreter ABI Platform
dotenvy-0.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 10.3 kB

Release files / dotenvy-0.2.0.tar.gz

Download URL dotenvy-0.2.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d2f28647834e9e5dcf410562bc123d22101cdc4008e14174a9a40357369e0a05
BLAKE2b-256 checksum
How to use checksums
89c884a53c56f18deaff349b69a712e4a34c787c77990b6dda2e6da78b9ee055
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / dotenvy-0.2.0-py2.py3-none-any.whl

Download URL dotenvy-0.2.0-py2.py3-none-any.whl
Size 6.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
06f496373cb7f67e746f1a73896da2a4562c231a42c9d61825d2a304e5073d19
BLAKE2b-256 checksum
How to use checksums
77b2f67b8ebbb682aa9e827dbd71bf10e7f1feaef36e43ab5d8668676422a538
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page