{ "info": { "author": "Ivan D Vasin", "author_email": "nisavid@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Operating System :: POSIX", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "###############\nSpruce-settings\n###############\n\nSpruce-settings is a Python library for application settings.\n\nSome applications require certain settings to exist before they are\nlaunched. Some applications require the ability to save certain\nsettings so that they persist after termination. It is desirable to\naccess both persistent and runtime settings via a uniform interface.\nThis package provides objects that satisfy these requirements.\n\nSettings may be stored in a variety of ways. Windows uses a system\nregistry. OS X uses XML preferences files. Many Unix applications use\nINI-style configuration (conf) files. It is desirable to store some\nsettings in a database. For now, this module implements only the conf\nfile method, but it provides enough abstraction to allow for other\nmethods to be implemented as needed.\n\n\n********\nExamples\n********\n\nSingle use\n==========\n\n.. code-block:: python\n\n import spruce.settings as _settings\n\n settings = _settings.Settings(organization='myorg',\n application='myapp')\n with settings.open(), settings.ingroup('db'):\n dbserver = settings.value('server', required=True)\n dbport = settings.intvalue('port')\n db_entity_tables = settings.listvalue('entity_tables')\n\n\nMultiple uses\n=============\n\n.. code-block:: python\n\n import spruce.settings as _settings\n\n settings = _settings.Settings(organization='myorg',\n application='myapp')\n with settings.open():\n with settings.ingroup('dbconn'):\n dbserver = settings.value('server', required=True)\n dbport = settings.intvalue('port')\n\n with settings.ingroup('dbtables'):\n db_entity_tables = settings.listvalue('entity_tables')\n\n\nFactory method\n==============\n\n.. code-block:: python\n\n from collections import namedtuple as _namedtuple\n\n import spruce.settings as _settings\n\n class User(_namedtuple('User', ('name', 'password'))):\n @classmethod\n def from_settings(cls, settings, group=None, name_key='name',\n password_key='password'):\n with settings.ingroup(group):\n name = settings.value(name_key, required=True)\n password = settings.value(password_key, required=True)\n return cls(name=name, password=password)\n\n settings = _settings.Settings(organization='myorg',\n application='myapp')\n with settings.open():\n user = User.from_settings(settings, 'user')\n\n\n******\nDesign\n******\n\nScopes\n======\n\nSettings may be specified for the entire system or per user. This scope\nis called the *base scope*.\n\nSettings are specific to organizations, applications, or subsystems,\nwhich are collectively called *component scopes*. Subsystems are\ngrouped by the applications to which they belong. Applications are\ngrouped by the organizations that produce them.\n\n\nSettings\n========\n\nEach setting is a *(key, value)* pair. A key is a non-empty string that\nidentifies the setting uniquely per application. A value is any string\n(or any object that can be represented as a string).\n\nKeys are case-sensitive.\n\n\nGroups\n======\n\nKeys can be grouped; for example, ``Book/Color`` and ``Book/PageCount``\nare both part of the ``Book`` group, and some storage formats (such as\nconf) may reflect this by writing ``Color`` and ``PageCount`` entries\ntogether in a ``Book`` section.\n\nGroups can be nested.\n\n\nLocations\n=========\n\nThe primary location is the unique location determined by the\ncombination of format, base scope, organization, application, and\nsubsystem specified when creating a **Settings** object.\n\nWhen settings are written, they are always written to the primary\nlocation.\n\nWhen a setting is queried, the primary location is searched first. If\nit is not found there, the fallback mechanism is triggered. First,\ngreater component scopes are searched. If the setting is not found\nthere and the base scope is ``user``, then the original component scope\nis searched in the ``system`` base scope, followed by the greater\ncomponent scopes in ``system``.\n\n\nFormats\n=======\n\nSettings formats specify where and how settings are stored. Each format\ndefines the file path at which settings are stored for a given scope and\nhow to read and write settings in those files.\n\n\n*********\nChangelog\n*********", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/nisavid/spruce-settings", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "GNU LESSER GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. \n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\n This version of the GNU Lesser General Public License incorporates\nthe terms and conditions of version 3 of the GNU General Public\nLicense, supplemented by the additional permissions listed below.\n\n 0. Additional Definitions.\n\n As used herein, \"this License\" refers to version 3 of the GNU Lesser\nGeneral Public License, and the \"GNU GPL\" refers to version 3 of the GNU\nGeneral Public License.\n\n \"The Library\" refers to a covered work governed by this License,\nother than an Application or a Combined Work as defined below.\n\n An \"Application\" is any work that makes use of an interface provided\nby the Library, but which is not otherwise based on the Library.\nDefining a subclass of a class defined by the Library is deemed a mode\nof using an interface provided by the Library.\n\n A \"Combined Work\" is a work produced by combining or linking an\nApplication with the Library. The particular version of the Library\nwith which the Combined Work was made is also called the \"Linked\nVersion\".\n\n The \"Minimal Corresponding Source\" for a Combined Work means the\nCorresponding Source for the Combined Work, excluding any source code\nfor portions of the Combined Work that, considered in isolation, are\nbased on the Application, and not on the Linked Version.\n\n The \"Corresponding Application Code\" for a Combined Work means the\nobject code and/or source code for the Application, including any data\nand utility programs needed for reproducing the Combined Work from the\nApplication, but excluding the System Libraries of the Combined Work.\n\n 1. Exception to Section 3 of the GNU GPL.\n\n You may convey a covered work under sections 3 and 4 of this License\nwithout being bound by section 3 of the GNU GPL.\n\n 2. Conveying Modified Versions.\n\n If you modify a copy of the Library, and, in your modifications, a\nfacility refers to a function or data to be supplied by an Application\nthat uses the facility (other than as an argument passed when the\nfacility is invoked), then you may convey a copy of the modified\nversion:\n\n a) under this License, provided that you make a good faith effort to\n ensure that, in the event an Application does not supply the\n function or data, the facility still operates, and performs\n whatever part of its purpose remains meaningful, or\n\n b) under the GNU GPL, with none of the additional permissions of\n this License applicable to that copy.\n\n 3. Object Code Incorporating Material from Library Header Files.\n\n The object code form of an Application may incorporate material from\na header file that is part of the Library. You may convey such object\ncode under terms of your choice, provided that, if the incorporated\nmaterial is not limited to numerical parameters, data structure\nlayouts and accessors, or small macros, inline functions and templates\n(ten or fewer lines in length), you do both of the following:\n\n a) Give prominent notice with each copy of the object code that the\n Library is used in it and that the Library and its use are\n covered by this License.\n\n b) Accompany the object code with a copy of the GNU GPL and this license\n document.\n\n 4. Combined Works.\n\n You may convey a Combined Work under terms of your choice that,\ntaken together, effectively do not restrict modification of the\nportions of the Library contained in the Combined Work and reverse\nengineering for debugging such modifications, if you also do each of\nthe following:\n\n a) Give prominent notice with each copy of the Combined Work that\n the Library is used in it and that the Library and its use are\n covered by this License.\n\n b) Accompany the Combined Work with a copy of the GNU GPL and this license\n document.\n\n c) For a Combined Work that displays copyright notices during\n execution, include the copyright notice for the Library among\n these notices, as well as a reference directing the user to the\n copies of the GNU GPL and this license document.\n\n d) Do one of the following:\n\n 0) Convey the Minimal Corresponding Source under the terms of this\n License, and the Corresponding Application Code in a form\n suitable for, and under terms that permit, the user to\n recombine or relink the Application with a modified version of\n the Linked Version to produce a modified Combined Work, in the\n manner specified by section 6 of the GNU GPL for conveying\n Corresponding Source.\n\n 1) Use a suitable shared library mechanism for linking with the\n Library. A suitable mechanism is one that (a) uses at run time\n a copy of the Library already present on the user's computer\n system, and (b) will operate properly with a modified version\n of the Library that is interface-compatible with the Linked\n Version.\n\n e) Provide Installation Information, but only if you would otherwise\n be required to provide such information under section 6 of the\n GNU GPL, and only to the extent that such information is\n necessary to install and execute a modified version of the\n Combined Work produced by recombining or relinking the\n Application with a modified version of the Linked Version. (If\n you use option 4d0, the Installation Information must accompany\n the Minimal Corresponding Source and Corresponding Application\n Code. If you use option 4d1, you must provide the Installation\n Information in the manner specified by section 6 of the GNU GPL\n for conveying Corresponding Source.)\n\n 5. Combined Libraries.\n\n You may place library facilities that are a work based on the\nLibrary side by side in a single library together with other library\nfacilities that are not Applications and are not covered by this\nLicense, and convey such a combined library under terms of your\nchoice, if you do both of the following:\n\n a) Accompany the combined library with a copy of the same work based\n on the Library, uncombined with any other library facilities,\n conveyed under the terms of this License.\n\n b) Give prominent notice with the combined library that part of it\n is a work based on the Library, and explaining where to find the\n accompanying uncombined form of the same work.\n\n 6. Revised Versions of the GNU Lesser General Public License.\n\n The Free Software Foundation may publish revised and/or new versions\nof the GNU Lesser General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\n Each version is given a distinguishing version number. If the\nLibrary as you received it specifies that a certain numbered version\nof the GNU Lesser General Public License \"or any later version\"\napplies to it, you have the option of following the terms and\nconditions either of that published version or of any later version\npublished by the Free Software Foundation. If the Library as you\nreceived it does not specify a version number of the GNU Lesser\nGeneral Public License, you may choose any version of the GNU Lesser\nGeneral Public License ever published by the Free Software Foundation.\n\n If the Library as you received it specifies that a proxy can decide\nwhether future versions of the GNU Lesser General Public License shall\napply, that proxy's public statement of acceptance of any version is\npermanent authorization for you to choose that version for the\nLibrary.", "maintainer": null, "maintainer_email": null, "name": "Spruce-settings", "package_url": "https://pypi.org/project/Spruce-settings/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Spruce-settings/", "project_urls": { "Download": "https://github.com/nisavid/spruce-settings", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/Spruce-settings/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Application settings", "version": "0.2.2" }, "last_serial": 980713, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "5dba693e7100118521b3d19d35a91bc9", "sha256": "be58c32cfb7de50ed7f43268a02c1456e99bf90bcc0ef1cad1ec17492966f6cb" }, "downloads": -1, "filename": "Spruce_settings-0.2.1-py2.7.egg", "has_sig": true, "md5_digest": "5dba693e7100118521b3d19d35a91bc9", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 19207, "upload_time": "2014-01-23T23:48:50", "url": "https://files.pythonhosted.org/packages/e4/17/a1370a9c0785af8f8cbff51d557421dcfa7a46edee776ebef28df91f7be8/Spruce_settings-0.2.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "066de00c9e4bf0a9ca05e754ffced7d8", "sha256": "f3a2ada30ed8102d3737db58cb5fa743402761f2e60fcad6e73d165e7c71f483" }, "downloads": -1, "filename": "Spruce_settings-0.2.1-py27-none-any.whl", "has_sig": true, "md5_digest": "066de00c9e4bf0a9ca05e754ffced7d8", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 25536, "upload_time": "2014-01-23T23:48:48", "url": "https://files.pythonhosted.org/packages/f8/42/3251b999d86240f9fb637a915899858f31e9795f15b2016c735f9cfc2ad4/Spruce_settings-0.2.1-py27-none-any.whl" }, { "comment_text": "", "digests": { "md5": "375bcbee3f1a5f84f504d371fad59733", "sha256": "881e35e977dea67b29905bfe9cbce527f2766cb6437f64b8c2461263cc795245" }, "downloads": -1, "filename": "Spruce-settings-0.2.1.tar.gz", "has_sig": true, "md5_digest": "375bcbee3f1a5f84f504d371fad59733", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33184, "upload_time": "2014-01-23T23:48:46", "url": "https://files.pythonhosted.org/packages/50/e6/c75b612338d4ad2add201178767bf453dfe7d7ac3bb098e2d6278c228aa2/Spruce-settings-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "ab9933043e78b06dc7d12ec543999892", "sha256": "e9e399d586c1494646637ccf2b9a5ba660830aec21683b8748d2f44e98faa445" }, "downloads": -1, "filename": "Spruce_settings-0.2.2-py2.7.egg", "has_sig": true, "md5_digest": "ab9933043e78b06dc7d12ec543999892", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 19244, "upload_time": "2014-01-24T20:35:44", "url": "https://files.pythonhosted.org/packages/44/09/03a091b6456792fe96a587d3894dbe33322c8721ba76d7d4ced13dd191ab/Spruce_settings-0.2.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "838a9c870543b92a0365496deb7b48a2", "sha256": "4b8625493921b954e5d7e47fc03c2da77d68c95cd7d7cd6ae73063b16b1ce99c" }, "downloads": -1, "filename": "Spruce_settings-0.2.2-py27-none-any.whl", "has_sig": true, "md5_digest": "838a9c870543b92a0365496deb7b48a2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 25081, "upload_time": "2014-01-24T20:35:41", "url": "https://files.pythonhosted.org/packages/2c/e2/763d8fbeca5f50a157aca790ba66822f9e75748ba8201aa1cc70f2b21acd/Spruce_settings-0.2.2-py27-none-any.whl" }, { "comment_text": "", "digests": { "md5": "907007e7fa8c6c3a7944814485ebb7ad", "sha256": "aa7ec318b823affaaee9536bee0c88b39947b6cf5015e23454bfe63fc8fbee60" }, "downloads": -1, "filename": "Spruce-settings-0.2.2.tar.gz", "has_sig": true, "md5_digest": "907007e7fa8c6c3a7944814485ebb7ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33278, "upload_time": "2014-01-24T20:35:39", "url": "https://files.pythonhosted.org/packages/32/28/0ea733e56b3b31208e33ecb86cc83e30ac9fa49ac74e04fc52305fcc973c/Spruce-settings-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab9933043e78b06dc7d12ec543999892", "sha256": "e9e399d586c1494646637ccf2b9a5ba660830aec21683b8748d2f44e98faa445" }, "downloads": -1, "filename": "Spruce_settings-0.2.2-py2.7.egg", "has_sig": true, "md5_digest": "ab9933043e78b06dc7d12ec543999892", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 19244, "upload_time": "2014-01-24T20:35:44", "url": "https://files.pythonhosted.org/packages/44/09/03a091b6456792fe96a587d3894dbe33322c8721ba76d7d4ced13dd191ab/Spruce_settings-0.2.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "838a9c870543b92a0365496deb7b48a2", "sha256": "4b8625493921b954e5d7e47fc03c2da77d68c95cd7d7cd6ae73063b16b1ce99c" }, "downloads": -1, "filename": "Spruce_settings-0.2.2-py27-none-any.whl", "has_sig": true, "md5_digest": "838a9c870543b92a0365496deb7b48a2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 25081, "upload_time": "2014-01-24T20:35:41", "url": "https://files.pythonhosted.org/packages/2c/e2/763d8fbeca5f50a157aca790ba66822f9e75748ba8201aa1cc70f2b21acd/Spruce_settings-0.2.2-py27-none-any.whl" }, { "comment_text": "", "digests": { "md5": "907007e7fa8c6c3a7944814485ebb7ad", "sha256": "aa7ec318b823affaaee9536bee0c88b39947b6cf5015e23454bfe63fc8fbee60" }, "downloads": -1, "filename": "Spruce-settings-0.2.2.tar.gz", "has_sig": true, "md5_digest": "907007e7fa8c6c3a7944814485ebb7ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33278, "upload_time": "2014-01-24T20:35:39", "url": "https://files.pythonhosted.org/packages/32/28/0ea733e56b3b31208e33ecb86cc83e30ac9fa49ac74e04fc52305fcc973c/Spruce-settings-0.2.2.tar.gz" } ] }