{ "info": { "author": "saaj", "author_email": "mail@saaj.me", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries" ], "description": ".. image:: https://img.shields.io/badge/dynamic/json.svg?url=https://api.bitbucket.org/2.0/repositories/saaj/clor/pipelines/?page=1%26pagelen=1%26sort=-created_on%26target.ref_name=default&label=build&query=$.values[0].state.result.name&colorB=blue\n :target: https://bitbucket.org/saaj/clor/addon/pipelines/home\n.. image:: https://badge.fury.io/py/Clor.png\n :target: https://pypi.python.org/pypi/Clor\n\n====\nClor\n====\nClor is a tiny wrapper around ``logging`` configuration system [1]_, which allows\nits reuse for general application configuration. The name was coined this way:\n\"configurator\" \u2192 \"c10r\" \u2192 \"clor\".\n\nUsage\n=====\nNormally there's a configuration module (e.g. ``envconf.py``), or a YAML file. Here\nis a CherryPy example::\n\n base = {\n 'global' : {\n 'server.socket_host' : '127.0.0.1',\n 'server.socket_port' : 8080,\n 'server.thread_pool' : 8\n },\n 'app' : {\n 'api' : {\n '/' : {\n 'request.dispatch' : {\n '()' : 'cherrypy._cpdispatch.MethodDispatcher'\n }\n }\n }\n }\n }\n\n production = (base, {\n 'global' : {\n 'server.socket_host' : '0.0.0.0',\n 'server.thread_pool' : 16,\n 'tools.auth_basic.on' : True,\n 'tools.auth_basic.realm' : 'App',\n 'tools.auth_basic.checkpassword' : 'ext://someapp.password.checker'\n },\n })\n\n development = (base, {\n 'global' : {\n 'server.thread_pool' : None,\n },\n 'app' : {\n 'api' : {\n '/' : {\n 'tools.response_headers.on' : True,\n 'tools.response_headers.headers' : [('Access-Control-Allow-Origin', '*')]\n }\n },\n 'api2' : 'cfg://app.api'\n }\n })\n\nA few observations:\n\n* Nest dictionaries are merged recursively\n* ``logging``'s ``ext`` pseudo-protocols\n* ``logging``'s ``cfg`` pseudo-protocols\n* ``logging``'s instantiation with ``()`` key\n* Keys having ``None`` value are removed\n\nThen in your bootstrapping code you can do::\n\n import clor\n\n from . import envconf\n\n\n config = clor.configure(*getattr(envconf, 'production'))\n\n cherrypy.config.update(config)\n cherrypy.tree.mount(ApiApplication(), '/api', config['app']['api'])\n\n\n.. [1] https://docs.python.org/3/library/logging.config.html\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/saaj/clor", "keywords": "python configuration-management", "license": "LGPL-2.1+", "maintainer": "", "maintainer_email": "", "name": "Clor", "package_url": "https://pypi.org/project/Clor/", "platform": "Any", "project_url": "https://pypi.org/project/Clor/", "project_urls": { "Homepage": "https://bitbucket.org/saaj/clor" }, "release_url": "https://pypi.org/project/Clor/0.3.2/", "requires_dist": null, "requires_python": "", "summary": "Application configuration via Python logging.config", "version": "0.3.2" }, "last_serial": 4975963, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "8edf29cd20f40f14039df40665162b7b", "sha256": "d350c3e900c2c0c8e89c7bb4572992fb161d362e9cd51d7c2153e3eb63bf15aa" }, "downloads": -1, "filename": "Clor-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8edf29cd20f40f14039df40665162b7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3511, "upload_time": "2017-09-16T12:10:58", "url": "https://files.pythonhosted.org/packages/27/1f/599306342be1068a22d8630da27351e0c975a8e9fdf3f36232e14ff2b2c1/Clor-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f368fb1e765f33a80f8d1cc83019b193", "sha256": "f835d03e739e6f7a5db3f66f7763cb0290f909f09addfe3f25870278d028cb80" }, "downloads": -1, "filename": "Clor-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f368fb1e765f33a80f8d1cc83019b193", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3522, "upload_time": "2017-09-17T10:58:02", "url": "https://files.pythonhosted.org/packages/bb/56/794627e3345f8a378c19cd4927aeeca4c1b5b5d5a75a19f34d510dc645cd/Clor-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "7abb1ed750e5a661305034d5422904c8", "sha256": "70d3d76a6284cb954182e630f764a2dc2391e0a8ad73d686732296edd0032949" }, "downloads": -1, "filename": "Clor-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7abb1ed750e5a661305034d5422904c8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3482, "upload_time": "2018-04-30T08:50:45", "url": "https://files.pythonhosted.org/packages/5a/1e/73006af4898afcc6d4b854c7e1436476e522b7d2d369dc3c45892761b3d6/Clor-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "6b84a49d46cb8837b5c660d88fb1ed0b", "sha256": "a6239a720dcc20b0d2a9c5099ce4b0e3e5efb350debf333f0a07b543d5e634b7" }, "downloads": -1, "filename": "Clor-0.2.1.tar.gz", "has_sig": false, "md5_digest": "6b84a49d46cb8837b5c660d88fb1ed0b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3627, "upload_time": "2018-06-09T20:43:45", "url": "https://files.pythonhosted.org/packages/40/fd/0851dfca9c96ca5ac5ce1e0f3f8464c1ea5a58c0b243a0ceedabd5bdde5b/Clor-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "5a48bff81df48973ced4985541050138", "sha256": "fb6f57aa4df9afe3497e9b9b189001156ff91ab6e7f0a6a254f40dfdaaec3abf" }, "downloads": -1, "filename": "Clor-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5a48bff81df48973ced4985541050138", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3717, "upload_time": "2019-03-10T11:33:56", "url": "https://files.pythonhosted.org/packages/9b/4e/1eab3de18b778a4973070c9ae59eda4f74d90c686b8ff8946051cd35769b/Clor-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "f368cace3f660297e34d2e8b5e3f857c", "sha256": "a52247744832365897faa091b30868b44e3d4d26ad8749cc591d3d5331403f25" }, "downloads": -1, "filename": "Clor-0.3.1.tar.gz", "has_sig": false, "md5_digest": "f368cace3f660297e34d2e8b5e3f857c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4445, "upload_time": "2019-03-10T21:10:52", "url": "https://files.pythonhosted.org/packages/37/2b/fd4e963e50a913055be46fc4e1f6a019ffd8a903e07c01de7cb0f4ee18db/Clor-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "5da22f36617dbc8349372a4603952f61", "sha256": "b08b80d8567cce41be266486c4241d23ab17d4ed501c15d731b5658f89e71fe8" }, "downloads": -1, "filename": "Clor-0.3.2.tar.gz", "has_sig": false, "md5_digest": "5da22f36617dbc8349372a4603952f61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4756, "upload_time": "2019-03-23T15:39:04", "url": "https://files.pythonhosted.org/packages/05/4d/83e0551c10b92fda25fd3bf86343742432ff7312fdc1d42e6495f9f3132b/Clor-0.3.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5da22f36617dbc8349372a4603952f61", "sha256": "b08b80d8567cce41be266486c4241d23ab17d4ed501c15d731b5658f89e71fe8" }, "downloads": -1, "filename": "Clor-0.3.2.tar.gz", "has_sig": false, "md5_digest": "5da22f36617dbc8349372a4603952f61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4756, "upload_time": "2019-03-23T15:39:04", "url": "https://files.pythonhosted.org/packages/05/4d/83e0551c10b92fda25fd3bf86343742432ff7312fdc1d42e6495f9f3132b/Clor-0.3.2.tar.gz" } ] }