{ "info": { "author": "Matt Story", "author_email": "matt.story@axial.net", "bugtrack_url": null, "classifiers": [], "description": "============\nbetterconfig\n============\n\nbetterconfig provides a more convenient and extensible configuration language,\nand a simpler interface built on python's builtin ConfigParser format, along\nwith a drastically simplified interface for loading configs.\n\nType Coercion Boilerplate Sucks\n===============================\n\nConfigParser, like many config languages, treats all values as strings,\nmeaning that when you have configs like this:\n\n::\n\n [config]\n foo = 1\n bar = a,list,of,strings\n baz = just a plain old string\n\nyou end up with boilerplate that looks like this:\n\n::\n\n from ConfigParser import ConfigParser\n MAP = {\n 'foo': int,\n 'bar': lambda x: x.split(','),\n 'baz': str,\n }\n c = ConfigParser()\n c.read('./foo.cfg')\n config = {k:MAP[k](v) for k,v in c.items('config')}\n\nDon't you really wish you could just do this:\n\n::\n\n [config]\n foo = 1\n bar = ['a', 'list', 'of', 'strings']\n baz = \"just a plain old string\"\n\nand drop the map?\n\n::\n\n import betterconfig\n config = betterconfig.load('./foo.cfg')['config']\n\nbetterconfig supports all literal types supported by ast.literal_eval_:\nstrings, numbers, tuples, lists, dicts, booleans, and None.\n\n.. _ast.literal_eval: http://docs.python.org/2/library/ast.html#ast.literal_eval\n\nMore Flexibility in Config, Less Config by Module\n=================================================\n\nWe wanted a config language that was as easy to use as a settings module in\ndjango or flask (and nearly as extensible), but less magical to initialize,\nand slightly safer than something like this:\n\n::\n\n import importlib\n settings = importlib.import_module('settings')\n\nSo we want a config that can do stuff like this:\n\n::\n\n top_level = 'variables defined outside of sections'\n include = ['./include.cfg', 'include.d/*.cfg']\n\n [section]\n namespaced = True\n\nAnd we don't want to have to iterate sections or items, we really just want to\nload it into a dict:\n\n::\n\n import betterconfig\n settings = betterconfig.load('./fancy.cfg')\n\nAnd if you're really in love with ``.`` notation, you can always do something\nsilly like make a module ``settings.py`` that does something magical like:\n\n::\n\n import betterconfig\n globals().update(betterconfig.load('./fancy.cfg'))\n\nInstalling\n==========\n\nThe betterconfig project lives on github_, and is available via pip_.\n\n.. _github: https://github.com/axialmarket/betterconfig\n.. _pip: https://pypi.python.org/pypi/betterconfig/0.3\n\nInstalling v0.3 From Pip\n------------------------\n\n::\n\n sudo pip install betterconfig==0.3\n\nInstalling v0.3 From Source\n---------------------------\n\n::\n\n curl https://github.com/axialmarket/betterconfig/archive/version_0.3.tar.gz | tar vzxf -\n cd betterconfig\n sudo python setup.py install\n\nRunning Tests\n=============\n\nThe betterconfig tests require py.test, which can be installed via pip.\n\n::\n\n sudo pip install pytest==2.5.2\n py.test test_betterconfig.py\n\n\n\nAuthors and Contributors\n========================\n\n| Matthew Story \n| Jon Rosebaugh \n| Inspired By: http://stackoverflow.com/a/6209146\n| Inspired By: http://stackoverflow.com/a/2819788", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/axialmarket/betterconfig", "keywords": null, "license": "3-BSD", "maintainer": null, "maintainer_email": null, "name": "betterconfig", "package_url": "https://pypi.org/project/betterconfig/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/betterconfig/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/axialmarket/betterconfig" }, "release_url": "https://pypi.org/project/betterconfig/0.3/", "requires_dist": null, "requires_python": null, "summary": "betterconfig -- A Better Config for Python", "version": "0.3" }, "last_serial": 1068100, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "40cc4e42c7d7d5e584b1678d5bba6380", "sha256": "ffabc0b53559beb44c9e71068880a5414e15b0278257a7b3b4ae6aea0ab57065" }, "downloads": -1, "filename": "betterconfig-0.1.tar.gz", "has_sig": false, "md5_digest": "40cc4e42c7d7d5e584b1678d5bba6380", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4867, "upload_time": "2014-02-05T21:49:12", "url": "https://files.pythonhosted.org/packages/1a/ad/8dfd002edf62ec4566dac47d4f4364c4d8f65bdfba85bbbe212d4e6f42e2/betterconfig-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "e189fcdb1011cba10e3d4e4b51fef94e", "sha256": "ad18ad3df6da2440784827aedd2f95a6fa8356ca408b1e802275bfcb2416ad8d" }, "downloads": -1, "filename": "betterconfig-0.2.tar.gz", "has_sig": false, "md5_digest": "e189fcdb1011cba10e3d4e4b51fef94e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5906, "upload_time": "2014-04-22T16:58:55", "url": "https://files.pythonhosted.org/packages/06/81/4481c4d5e231ea3ba2bc14c8f99b11524c13e63cc5e4ba895b4997d47fea/betterconfig-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "ae662044790e622dea1c7b1b472a537f", "sha256": "c48abd88b154aeb9f4344693a2dee81d307df2b00a526c164b15801c20e27f75" }, "downloads": -1, "filename": "betterconfig-0.3.tar.gz", "has_sig": false, "md5_digest": "ae662044790e622dea1c7b1b472a537f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5935, "upload_time": "2014-04-22T16:56:00", "url": "https://files.pythonhosted.org/packages/e2/56/cc1425e7b7b2fd9a4a01bcd0b76f0fd9cdafdb9c4a9369d40f2f91e2156f/betterconfig-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ae662044790e622dea1c7b1b472a537f", "sha256": "c48abd88b154aeb9f4344693a2dee81d307df2b00a526c164b15801c20e27f75" }, "downloads": -1, "filename": "betterconfig-0.3.tar.gz", "has_sig": false, "md5_digest": "ae662044790e622dea1c7b1b472a537f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5935, "upload_time": "2014-04-22T16:56:00", "url": "https://files.pythonhosted.org/packages/e2/56/cc1425e7b7b2fd9a4a01bcd0b76f0fd9cdafdb9c4a9369d40f2f91e2156f/betterconfig-0.3.tar.gz" } ] }