Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spoqa/settei
Configuration utility for common Python applications and services
https://github.com/spoqa/settei
config configuration dependency-injection python python3
Last synced: 3 months ago
JSON representation
Configuration utility for common Python applications and services
- Host: GitHub
- URL: https://github.com/spoqa/settei
- Owner: spoqa
- License: apache-2.0
- Created: 2016-03-30T08:47:21.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-10-29T05:05:46.000Z (over 4 years ago)
- Last Synced: 2024-08-09T09:29:01.809Z (6 months ago)
- Topics: config, configuration, dependency-injection, python, python3
- Language: Python
- Homepage: https://settei.readthedocs.io/
- Size: 162 KB
- Stars: 18
- Watchers: 11
- Forks: 9
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Settei
======.. image:: https://readthedocs.org/projects/settei/badge/?version=latest
:target: https://settei.readthedocs.io/
:alt: Documentation Status.. image:: https://badge.fury.io/py/settei.svg
:target: https://badge.fury.io/py/settei.. image:: https://travis-ci.org/spoqa/settei.svg
:target: https://travis-ci.org/spoqa/setteiConfiguration utility for common Python applications and services.
FYI, "settei" (設定) means settings in Japanese. :)Loading a configuration is easy
-------------------------------Suppose you use `Flask`_ with Settei.
.. code-block:: python
from flask import Flask
from settei import Configuration, config_propertyclass WebConfiguration(Configuration):
"""Load Configuration::[web]
debug = true"""
#: debug option
debug = config_property('web.debug', bool, default=False)conf = WebConfiguration.from_path(pathlib.Path('.') / 'dev.toml')
app = Flask(__name__)if __name__ == '__main__':
app.run(debug=conf.debug).. _Flask: http://flask.pocoo.org/