Dotenv handler for Python
Project description
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.
Source Distribution
dotenvy-0.2.0.tar.gz
(4.0 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 dotenvy-0.2.0.tar.gz.
File metadata
- Download URL: dotenvy-0.2.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2f28647834e9e5dcf410562bc123d22101cdc4008e14174a9a40357369e0a05
|
|
| MD5 |
7dc8af471f809eed6692f6d0e71d508f
|
|
| BLAKE2b-256 |
89c884a53c56f18deaff349b69a712e4a34c787c77990b6dda2e6da78b9ee055
|
File details
Details for the file dotenvy-0.2.0-py2.py3-none-any.whl.
File metadata
- Download URL: dotenvy-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06f496373cb7f67e746f1a73896da2a4562c231a42c9d61825d2a304e5073d19
|
|
| MD5 |
cbca531700a6729d441c1f918e2c1e00
|
|
| BLAKE2b-256 |
77b2f67b8ebbb682aa9e827dbd71bf10e7f1feaef36e43ab5d8668676422a538
|