{ "info": { "author": "WangST", "author_email": "shaotian.wang@ele.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4" ], "description": "Introduction\n==============\n\n``econf`` make it easy to define config options and reference them.\nThe options can be provided through command line or config file.\n\nInstall\n=========\n\n::\n\n $ pip install http://github.com/wangst321/econf.git\n\nHow to Use\n============\n\ndefine options\n----------------\n\nFirst, import ``econf`` ::\n\n from econf import *\n\nFor default options, that belong to 'default' section::\n\n from econf import BaseConf\n\n class DefaultConf(BaseConf):\n host = StrOpt(default='0.0.0.0', cmdline=True,\n help='ip address')\n port = IntOpt(default=9090, cmdline=True,\n help='tcp port')\n\nFor options belong to other section::\n\n class ZKConf(BaseConf):\n __section__ = 'zk'\n\n hosts = StrOpt(\n required=True,\n help='list of zookeeper ip:port pair. i.e. localhost:2181')\n max_retry = IntOpt(\n default=3,\n help='number of tries before giving up connecting')\n\nuse options in your code\n--------------------------\n\nThere are two ways to reference an option.\nFirst, use the specific Conf Class::\n\n host, port = DefaultConf.host, DefaultConf.port\n\nSecond, use the general CONF::\n\n host, port = CONF.host, CONF.port\n zk_hosts = CONF.zk.hosts\n\nparse cli options and config file\n-----------------------------------\n\n.. note::\n\n When the code executes, this step should always be in front of those\n statements, which reference options.\n\nIf a default config is supplied::\n\n from econf import CONF\n CONF('path/to/your/default.conf')\n\nor, ::\n\n from econf import CONF\n CONF()\n\nUsually, this code is executed just before your service gonna start. ::\n\n def run():\n from econf import CONF\n CONF()\n\n my_service.init(CONF.host, CONF.port, ...)\n my_service.start()", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/wangst321/econf.git", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "econf", "package_url": "https://pypi.org/project/econf/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/econf/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/wangst321/econf.git" }, "release_url": "https://pypi.org/project/econf/0.1.4/", "requires_dist": null, "requires_python": null, "summary": "easy to define and reference config options", "version": "0.1.4" }, "last_serial": 1868140, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "7d11c3fe1ee307d9fed4b0b0a9f9203d", "sha256": "8ce64973686282b36cbdcb4a58a6d8ea2712589b50c0046af60debb6667c217d" }, "downloads": -1, "filename": "econf-0.1.tar.gz", "has_sig": false, "md5_digest": "7d11c3fe1ee307d9fed4b0b0a9f9203d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4505, "upload_time": "2015-09-02T01:40:21", "url": "https://files.pythonhosted.org/packages/d6/0f/894d547ade12ddc8f6eb525ed37b2e1baa16ca2d8f40410c13fea15ce70c/econf-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "0d35c945170901ae54f68ba77abb01e4", "sha256": "23d5ff6a583b3dd00e6468e4baef109f3b813957cc3a79eb8ef1b9a302ff5db7" }, "downloads": -1, "filename": "econf-0.1.1.tar.gz", "has_sig": false, "md5_digest": "0d35c945170901ae54f68ba77abb01e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5204, "upload_time": "2015-09-03T17:12:32", "url": "https://files.pythonhosted.org/packages/06/60/25118a8584e1e0dbaf41991a6e222b8469bafd67ec63dd6c8bff71bd5774/econf-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "5a90d256870fce0ebfb23c3d184d2a1d", "sha256": "f8d8384f16016078c9b307d81e92745644e2ced3255c4ed7e5f25ba02495ccef" }, "downloads": -1, "filename": "econf-0.1.2.tar.gz", "has_sig": false, "md5_digest": "5a90d256870fce0ebfb23c3d184d2a1d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5274, "upload_time": "2015-10-27T15:33:03", "url": "https://files.pythonhosted.org/packages/ab/b4/da77339df7f8f2f806baf8e5b900202ecee0a09734e49c25eb4c350af607/econf-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "c812e05c2cc10b060a0843f77f56a942", "sha256": "26c0fea0cfab622c97161b67f518ff2652c3ca5c293b7d1c7dd2f070ea9011be" }, "downloads": -1, "filename": "econf-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c812e05c2cc10b060a0843f77f56a942", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5354, "upload_time": "2015-10-27T15:55:01", "url": "https://files.pythonhosted.org/packages/c6/bb/343b047e2d3f35ba72fc33e6271a2a20288741bf37718c3e1d63730eb556/econf-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "1be919bbf8e0cf59470d2d21bf7959e5", "sha256": "b2f06b914b98a3925d1afa6d3575685a27551615df7e7abc01bf9d09e3a62217" }, "downloads": -1, "filename": "econf-0.1.4.tar.gz", "has_sig": false, "md5_digest": "1be919bbf8e0cf59470d2d21bf7959e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5359, "upload_time": "2015-12-18T04:14:46", "url": "https://files.pythonhosted.org/packages/0e/5e/edd22686937a67c504442e0f2dde16565238b5d198e15ba7738ecee80f41/econf-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1be919bbf8e0cf59470d2d21bf7959e5", "sha256": "b2f06b914b98a3925d1afa6d3575685a27551615df7e7abc01bf9d09e3a62217" }, "downloads": -1, "filename": "econf-0.1.4.tar.gz", "has_sig": false, "md5_digest": "1be919bbf8e0cf59470d2d21bf7959e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5359, "upload_time": "2015-12-18T04:14:46", "url": "https://files.pythonhosted.org/packages/0e/5e/edd22686937a67c504442e0f2dde16565238b5d198e15ba7738ecee80f41/econf-0.1.4.tar.gz" } ] }