{ "info": { "author": "Jeff Hammel", "author_email": "k0scist@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "configuration\n=============\n\nmulti-level unified configuration for python consumption\n\n - you have a (python) program that wants to read configuration from\n configuration files (I currently support JSON and YAML) and also\n from the command line [TODO: environment variables]\n\n - you want to be able to serialize and deserialize configuration\n\n\nBasic Usage\n-----------\n\nThe ``configuration.Configuration`` class is an abstract base\nclass that extends ``optparse.OptionParser``. The form of the\nconfiguration is dictated by setting the ``options`` attribute on your\nsubclass. ``options`` is a dictionary of the form::\n\n {'name': {}}\n\n``name`` is the name of the configuration option, and ``value`` is a\n``dict`` that gives the form of the option.\n\n``Configuration`` transforms these options into ``OptionParser`` options.\n\nOptions for ``value`` include:\n\n * help : what the option is about (translated to command line help)\n * default: default value for the option\n * required: if a true value, this option must be present in the\n configuration. If ``required`` is a string, it will be displayed if\n the option is not present. If the default is defined, you won't\n need required as the default value will be used\n * type: type of the option. Used to control the parsing of the option\n * flags: a list that, if present, will be used for the command line\n flags. Othwise, the option name prepended by ``--`` will be used.\n To disable as a command line option, use an empty list ``[]``\n\nIn addition, you may extend ``Configuration`` and have additional\nuseful items in the ``value`` dict for ``options``.\n\nFor an example, see\nhttp://k0s.org/mozilla/hg/configuration/file/c831eb58fb52/tests/example.py#l7\n\n\nConfiguration Files\n-------------------\n\nConfig files are useful for (IMHO) A. complicated setup;\nB. reproducibility; C. being able to share run time configurations.\nThe latter is mostly useful if the configuration contains nothing\nmachine-specific (e.g. the path to an executable might vary from\nmachine to machine) or if the configuration is overridable from the\ncommand line.\n\n``configuration`` features the ability to serialize (dump) and deserialize\n(load) configuration from a pluggable set of formats. By default,\n``--dump `` will dump the resultant configuration (that\ngathered from the command line options and loaded configuration files)\nto a file of format dictate by the file extension (Example:\n``--dump mydumpfile.json`` will use JSON format). The flag for the\noption, e.g. ``--dump``, may be set via the ``dump`` parameter to\n``Configuration``'s constructor.\n\n``Configuration`` instances can also deserialize data. The normal case of\nusing configuration is when you want to be able to read from\nconfiguration files. By default, ``Configuration`` instances read\npositional arguments for configuration files to be loaded. If you\nspecify a ``load`` argument to the ``Configuration`` constructor, this\noption will be used instead. Likewise, the file extension will be\nused to determine the format.\n\nThe `configuration package `_\nrequires ``json``(``simplejson`` on older python) and ``PyYAML`` so\nthese serializers/deserializers are available if you install the package.\n\n\nExtending Configuration\n-----------------------\n\n``configuration`` is designed to be pluggable. While you get a useful\nset of behaviour out of the box, most of the handlers for\n``configuration`` may be manipulated to do what you want to do.\n\n``Configuration``'s constructor takes an argument, ``types``, which is\na dictionary of callables keyed on type that translate\n``Configuration.options`` into ``optparse`` options. If one of\n``Configuration.options`` type isn't specified (or is ``None``), then\nthe default is used (``configuration.base_cli`` unless you override this).\nIf not passed, a ``Configuration`` instance uses ``configuration.types``.\n\nThe callables in ``types`` should take the option name and value\ndictionary and should return the args and keyword args necessary to\ninstantiate an ``optparse.Option``.\n\n``Configuration``'s constructor also accepts an option,\n``configuration_providers``, that is a list of\nserializers/deserializers to use. These should be objects with a list\nof ``extensions`` to use, a ``read(filename)`` method that will load\nconfiguration, and a ``write(config, filename)`` method to write it.\n``read`` should return the read configuration.\nIf ``write`` is not present the provider cannot serialize.\n\nTODO\n----\n\n * Add http://k0s.org/hg/ConfigOptionParser and deprecate it\n\n\nSee Also\n--------\n\n * https://pypi.python.org/pypi/crumbs/, https://github.com/alunduil/crumbs\n\n----\n\nJeff Hammel\n\nhttp://k0s.org/hg/configuration", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://k0s.org/hg/configuration", "keywords": null, "license": "MPL", "maintainer": null, "maintainer_email": null, "name": "configuration", "package_url": "https://pypi.org/project/configuration/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/configuration/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://k0s.org/hg/configuration" }, "release_url": "https://pypi.org/project/configuration/0.4.2/", "requires_dist": null, "requires_python": null, "summary": "multi-level unified configuration", "version": "0.4.2" }, "last_serial": 1046384, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "c07761db0e95dac1527e7fca37ecb163", "sha256": "5a0e4eec0eadd9af09fa3fdbc816a877ef1e77af2f0c01c159434677f735a5b6" }, "downloads": -1, "filename": "configuration-0.1.tar.gz", "has_sig": false, "md5_digest": "c07761db0e95dac1527e7fca37ecb163", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6326, "upload_time": "2012-03-28T20:19:35", "url": "https://files.pythonhosted.org/packages/33/64/2dea329e99a551d1fdf47d72ed0119d512b3689d8272ae50e3fed0bbbf82/configuration-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ef220c24d195cc07185f374cf22fa4ca", "sha256": "506d28078f79e752a9eb0aa579e92c5ba0c08e55ac37b8efee11f001bec3ae4b" }, "downloads": -1, "filename": "configuration-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ef220c24d195cc07185f374cf22fa4ca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7367, "upload_time": "2012-03-29T00:24:53", "url": "https://files.pythonhosted.org/packages/20/93/30fad37d186d9e13e6278cc3a5620dc8ef5d80bc2e6abe1009f047cc66b8/configuration-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a84f5ccd28a7afd089e6952f9feb060c", "sha256": "ee5bcd308ef2856bd93c6d1610c78e8ea8dbc09be5724b2fa36b6ae3c9238ea5" }, "downloads": -1, "filename": "configuration-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a84f5ccd28a7afd089e6952f9feb060c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7644, "upload_time": "2012-04-17T21:50:53", "url": "https://files.pythonhosted.org/packages/be/23/0014ee7ed0ebb32fc4c8b9d3122347cc8cb6224d4167582ff223ebe032fe/configuration-0.1.2.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "cdf98701632d34ee767713353a4155fb", "sha256": "fac1568a865da6430f68b64b65b434557ea7d1330ff87eb84858cb2ad6698a7f" }, "downloads": -1, "filename": "configuration-0.2.tar.gz", "has_sig": false, "md5_digest": "cdf98701632d34ee767713353a4155fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7586, "upload_time": "2012-04-30T04:18:56", "url": "https://files.pythonhosted.org/packages/81/0d/c26baf752ba7bbbd0ad0a173c9f70b46a56727b0b11c44721395aeb7ddda/configuration-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "4fc2f0c747796099995f1867178fdf64", "sha256": "c5b6a4083830003c36bd2b5a376d26da969fb3e5dcaa30950ccd485e6add69fb" }, "downloads": -1, "filename": "configuration-0.2.1.tar.gz", "has_sig": false, "md5_digest": "4fc2f0c747796099995f1867178fdf64", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7817, "upload_time": "2012-05-02T21:21:23", "url": "https://files.pythonhosted.org/packages/7f/8a/08bd068b10f7bd5514e256f2b1bfc539a08cff40de15f1e24aff62f3305f/configuration-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "76b9608450b62df7019087fae7166176", "sha256": "f9f8c5cbb57a0310e5ac4fa5a189f94f3b5a90e1696035b4c259eb179c21ad91" }, "downloads": -1, "filename": "configuration-0.2.2.tar.gz", "has_sig": false, "md5_digest": "76b9608450b62df7019087fae7166176", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7858, "upload_time": "2012-05-11T00:24:09", "url": "https://files.pythonhosted.org/packages/a7/ed/386b251ba148962e0df633e127717994bf884c3a7ace43c85896fd472303/configuration-0.2.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "1e771a53e9831b01327af098104fb4e4", "sha256": "5712699b58b44cda73b55d63312490e371271ef3e6196705700247a7718e8483" }, "downloads": -1, "filename": "configuration-0.3.tar.gz", "has_sig": false, "md5_digest": "1e771a53e9831b01327af098104fb4e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7881, "upload_time": "2012-07-04T18:55:00", "url": "https://files.pythonhosted.org/packages/de/9c/69abf047e04ca83a03ea33b35dcb728ee84ab283912685195fc08719b28e/configuration-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "793e3d396e686ef9ce0dff090be817ee", "sha256": "338945a074f9c8c294cade1e5f1abab9cfd91c9c277b4a9635356490896a477a" }, "downloads": -1, "filename": "configuration-0.3.1.tar.gz", "has_sig": false, "md5_digest": "793e3d396e686ef9ce0dff090be817ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7995, "upload_time": "2012-10-02T00:09:17", "url": "https://files.pythonhosted.org/packages/19/d8/22b92c8e8cb169df913085daf09014a8f038e8022d2e8253709f751c5b2a/configuration-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "ac1b81da3023c6776a07d97e3f4a336f", "sha256": "78f2789737f2ffc928a087fe17b237a48a9ff2dbd3ce4f4b029ea17d2e0f06ad" }, "downloads": -1, "filename": "configuration-0.3.2.tar.gz", "has_sig": false, "md5_digest": "ac1b81da3023c6776a07d97e3f4a336f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8071, "upload_time": "2012-12-07T00:16:59", "url": "https://files.pythonhosted.org/packages/f8/3c/337e0649d49b25f0147d2ee21dee202ae778d7f18def993cebfc5d00f4c4/configuration-0.3.2.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "9585d2152a54a49a0b41204bb4e413cc", "sha256": "f01193f88c3c0ced54fa256de180e2d2317897a8f28ac720efdccbce3b611a6d" }, "downloads": -1, "filename": "configuration-0.4.tar.gz", "has_sig": false, "md5_digest": "9585d2152a54a49a0b41204bb4e413cc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9722, "upload_time": "2013-09-18T03:19:25", "url": "https://files.pythonhosted.org/packages/33/37/8cbc71bc83f0044600d52f0e9a35dbaa596254e00134a80ff4a627fd852f/configuration-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "30efd77d0bf068feebc376b70e703bed", "sha256": "b87bb2926dda50ae65635b8dfdd98595747a2dfec651a1f50778ea9fb5a5a902" }, "downloads": -1, "filename": "configuration-0.4.1.tar.gz", "has_sig": false, "md5_digest": "30efd77d0bf068feebc376b70e703bed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9718, "upload_time": "2013-09-18T03:48:02", "url": "https://files.pythonhosted.org/packages/38/4c/206b641fb1796a4138f8dd60edcc0d59a446a327ad403c08382fe308d4fd/configuration-0.4.1.tar.gz" } ], "0.4.2": [ { "comment_text": "", "digests": { "md5": "c310e26eda6ea502850e1b6d33ce4f0e", "sha256": "d35cd73d51496f4061b32dba8411703593f46b96bf116b474e0efc975c277d0d" }, "downloads": -1, "filename": "configuration-0.4.2.tar.gz", "has_sig": false, "md5_digest": "c310e26eda6ea502850e1b6d33ce4f0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10323, "upload_time": "2014-03-31T02:28:17", "url": "https://files.pythonhosted.org/packages/36/6e/22a6b49e30c6931867389841895f3fee617a4b121fcfc9c9a4441c0d0fa4/configuration-0.4.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c310e26eda6ea502850e1b6d33ce4f0e", "sha256": "d35cd73d51496f4061b32dba8411703593f46b96bf116b474e0efc975c277d0d" }, "downloads": -1, "filename": "configuration-0.4.2.tar.gz", "has_sig": false, "md5_digest": "c310e26eda6ea502850e1b6d33ce4f0e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10323, "upload_time": "2014-03-31T02:28:17", "url": "https://files.pythonhosted.org/packages/36/6e/22a6b49e30c6931867389841895f3fee617a4b121fcfc9c9a4441c0d0fa4/configuration-0.4.2.tar.gz" } ] }