Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chickenzord/dotenvy
Dotenv handler for Python
https://github.com/chickenzord/dotenvy
dotenv environment-variables library
Last synced: 18 days ago
JSON representation
Dotenv handler for Python
- Host: GitHub
- URL: https://github.com/chickenzord/dotenvy
- Owner: chickenzord
- License: mit
- Created: 2017-09-13T06:43:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-08T15:47:34.000Z (almost 7 years ago)
- Last Synced: 2024-11-11T11:14:03.710Z (about 1 month ago)
- Topics: dotenv, environment-variables, library
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
dotenvy
=======.. image:: https://img.shields.io/travis/chickenzord/dotenvy.svg?style=flat-square
:target: https://travis-ci.org/chickenzord/dotenvy
:alt: Build status.. image:: https://img.shields.io/coveralls/chickenzord/dotenvy.svg?style=flat-square
:target: https://coveralls.io/github/chickenzord/dotenvy
:alt: Coverage status.. image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square
:target: https://raw.githubusercontent.com/chickenzord/dotenvy/master/LICENSE.txt
:alt: MIT license.. image:: https://img.shields.io/pypi/v/dotenvy.svg?style=flat-square
:target: https://pypi.python.org/pypi/dotenvy
:alt: PyPI package version.. image:: https://img.shields.io/pypi/pyversions/dotenvy.svg?style=flat-square
:target: https://pypi.python.org/pypi/dotenvy
:alt: PyPI python versionDotenv handler for Python
usages
------Installing ::
pip install dotenvy
Common usage as library ::
from dotenvy import load_env, read_file
from os import environload_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 rundevelopment
-----------Checking codestyle ::
./setup.py stylecheck
Running tests ::
./setup.py test
Running tests on all supported python versions ::
pip install tox
tox