Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/winkidney/envorm
Environment-variables as config made easy.
https://github.com/winkidney/envorm
config docker environment-variables orm
Last synced: 2 months ago
JSON representation
Environment-variables as config made easy.
- Host: GitHub
- URL: https://github.com/winkidney/envorm
- Owner: winkidney
- License: mit
- Created: 2017-10-18T06:01:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-23T12:32:44.000Z (almost 5 years ago)
- Last Synced: 2024-11-19T01:26:50.834Z (2 months ago)
- Topics: config, docker, environment-variables, orm
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ENV ORM
---------------Build status: [![CircleCI](https://circleci.com/gh/winkidney/envorm.svg?style=svg)](https://circleci.com/gh/winkidney/envorm)
**Environment-variables as config made easy.**
An utility library that helps you
to use environment-variables from an orm-like interface.It helps a lot especially you prefers to use docker as your app runner.
## Feature
+ ORM-like interface(or wtforms-like)
+ validation included
+ Auto type-conversion
+ Doc/Example config for ORM object## ChangeLog
+ Wed May 2 01:56:54 PDT 2018 - Add doc/example config env output
## Install
```
pip install envorm
```or
```
git clone https://github.com/winkidney/envorm.git
cd envorm
python setup.py install
```## Usage
```python
import envorm as ormclass Model(orm.EnvModel):
example = orm.StringField(
"IP_ADDR",
default="0.0.0.0",
required=False,
)# initialize
settings = Model()# validation
settings.is_valid()# Use the value
settings.example.value# update if env changed
settings.update()# list settings field in command line
# if you want to provide an interface to show
# what config is needed and show its default value
settings.list_names()# Print config doc (or just copy it as example config file)
print(settings.doc())```