Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillotinaweb/econfig
Python configuration management with environment variables
https://github.com/guillotinaweb/econfig
Last synced: 7 days ago
JSON representation
Python configuration management with environment variables
- Host: GitHub
- URL: https://github.com/guillotinaweb/econfig
- Owner: guillotinaweb
- Created: 2017-12-27T16:41:29.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-27T19:38:56.000Z (almost 7 years ago)
- Last Synced: 2024-08-09T03:54:31.063Z (3 months ago)
- Language: Python
- Size: 16.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
Awesome Lists containing this project
README
Env Config
==========Python package to manage configuration from environment variables.
This package is designed to be used to help in configuration management with
python docker containers.Defining configuration
----------------------econfig provides simple data types to define configuration with::
import econfig
econfig.register(
name='MY_CONFIGURATION_NUMBER',
type=econfig.types.int,
destination='foo.bar')
econfig.register(
name='MY_CONFIGURATION_NUMBER',
type=econfig.types.json,
destination='foo.json')
errors, settings = econfig.parse()
settings == {
"foo": {
"bar": 5
},
"json": {
"some": "value"
}
}Types
------ int
- float
- bool
- exists
- json
- when_exists: callable type that will provide value when env variable existsDestination types
------------------ `foo.bar`: automatic key value dictionary creation
- `foo[]`: append value to list
- `foo[0]`: address item in list
- `foo[0].bar`: address dictionary item in list