{ "info": { "author": "Dominik \"Socek\" D\u0142ugajczy", "author_email": "msocek@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "SmallSettings\n=============\n\nIn many projects (web applicatons in particular) there is a need of making a settings. For application we need a 3 types of settings.\n* Application settings (for example: application name)\n* Envoritment settings (for example: url to database)\n* Dynamic settings (for example: what ads to we show today)\n\nSmallSettings provides solusion for the first 2 types of settings (the third one should be stored in the database).\nThe second problem with settings is wrapping some settings. Sometimes you have to wrap var from app settings in envoritment settings, and sometime you have to do the oposit. SmallSettings has a solution for this.\n\nSettings classes\n========\nFirst we look at the \"Settings\" class.\n\n >> from smallsettings import Settings\n >> settings = Settings({'base_settings': 1})\n >> settings['base_settings']\n 1\n\nPretty normal dict. But it have a special features:\n\n >> settings['something'] = 'new settings %(base_settings)s'\n >> settings['something']\n 'new settings 1'\n\nWe can now ovveride the 'base_settings':\n\n >> settings['base_settings'] = 2\n >> settings['something']\n 'new settings 2'\n\nSecond, the \"Paths\" class.\n\n >> from smallsettings import Paths\n >> paths = Paths({'base' : '/tmp'})\n >> paths['base']\n '/tmp'\n >> paths['home'] = '/home'\n >> paths['home']\n '/home'\n\nBut using previous var is slite different, because the Paths class use os.path.join:\n\n >> paths['me'] = ['%(home)s', 'me']\n >> paths['me']\n '/home/me'\n\nIf we want to \"merge\" settings and paths, we co do this:\n\n >> merged = settings.merged(paths)\n >> merged['something']\n 'new settings 2'\n >> merged['me']\n '/home/me'\n\nFactory\n=======\n\nIf we want to use 'modulename.settings' where 'modulename' is our main module and\n'settings' is our settins module.\n\n >> from smallsettings import Factory\n >> factory = Factory('modulename', 'settings')\n >> settings, paths = factory.make_settings()\n\nIt will read the settings from modulename/settings/default.py. This file should\nlooks like this:\n\n >> def make_settings(settings, paths):\n >> settings['name'] = 'value'\n\nIf we want to add some additional files for settings, like \"local.py\", we can do\nthis:\n\n >> settings, paths = factory.make_settings(additional_modules=[('local', False)])\n\nThis is the default behavior. The bool means \"raise error on missing module\".", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "SmallSettings", "package_url": "https://pypi.org/project/SmallSettings/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/SmallSettings/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/SmallSettings/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "Simple settings functions for projects.", "version": "0.2.2" }, "last_serial": 949534, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "a3927768623df59e5c6105744b7f1941", "sha256": "f3f9fb22bfeee2150ad53e771d3470143b2d2191662501dd7d81acc95178df27" }, "downloads": -1, "filename": "SmallSettings-0.2-py2.7.egg", "has_sig": false, "md5_digest": "a3927768623df59e5c6105744b7f1941", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 13792, "upload_time": "2013-09-18T05:36:51", "url": "https://files.pythonhosted.org/packages/ec/ca/51f29974773b199bf6c5daad867d669a9773c6469dcb6c33d8d63f0aa1de/SmallSettings-0.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "5b76f700360ccbfcbaa0b8625ba42115", "sha256": "46545ff3994823ffec089047f50942e5c965f4b214f3639552a666db1965cb0e" }, "downloads": -1, "filename": "SmallSettings-0.2.tar.gz", "has_sig": false, "md5_digest": "5b76f700360ccbfcbaa0b8625ba42115", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4689, "upload_time": "2013-09-18T05:36:59", "url": "https://files.pythonhosted.org/packages/be/12/1eb687a4a76db790b0ce34c8da345d568265975e62c093595aca24b05c0b/SmallSettings-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "2fc583e31dfddc01ac5694809c080dbf", "sha256": "b4037349064c2b85038e845a0d424ba9f9b816143a62826e3124c10d80f22802" }, "downloads": -1, "filename": "SmallSettings-0.2.1-py3.3.egg", "has_sig": false, "md5_digest": "2fc583e31dfddc01ac5694809c080dbf", "packagetype": "bdist_egg", "python_version": "3.3", "requires_python": null, "size": 15053, "upload_time": "2013-12-17T15:11:46", "url": "https://files.pythonhosted.org/packages/1d/c2/3590acadb1675e3685e73a019680faf39bfc7facb1e9a21cd9a6c545bee0/SmallSettings-0.2.1-py3.3.egg" }, { "comment_text": "", "digests": { "md5": "9f900288ada944e3202d85f7b0b2ffe7", "sha256": "5f46a80a98723537047e08a50ea43fe9a752abc65b5acbdb07cd162adc65be81" }, "downloads": -1, "filename": "SmallSettings-0.2.1.tar.gz", "has_sig": false, "md5_digest": "9f900288ada944e3202d85f7b0b2ffe7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4799, "upload_time": "2013-12-17T15:12:05", "url": "https://files.pythonhosted.org/packages/d2/19/cb572646ed99f80491f18796ec486c6c45acd56949dc53936cb3a52b974b/SmallSettings-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "341805f550357e61b234becedfd07dfb", "sha256": "71b2bc1265c192e2410c0d8506b2180777d88a8c0265e1582dfcad4052224851" }, "downloads": -1, "filename": "SmallSettings-0.2.2-py2.7.egg", "has_sig": false, "md5_digest": "341805f550357e61b234becedfd07dfb", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 15183, "upload_time": "2013-12-20T10:18:28", "url": "https://files.pythonhosted.org/packages/d6/6a/0593841ab4746bdf302be77eb78fe3068ead9de55d87790a121f50752eae/SmallSettings-0.2.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "319f28b16e2d5568c9a5947f56c703c1", "sha256": "bfd6fe1a98da99c151106c3abe8443814671cd4fd9cd9331d5c768d616d92e83" }, "downloads": -1, "filename": "SmallSettings-0.2.2-py3.3.egg", "has_sig": false, "md5_digest": "319f28b16e2d5568c9a5947f56c703c1", "packagetype": "bdist_egg", "python_version": "3.3", "requires_python": null, "size": 16119, "upload_time": "2013-12-17T15:24:12", "url": "https://files.pythonhosted.org/packages/d2/44/07cf7465f09a11a9f9513af4bebd25e2322078bdcbc678db7257860f63a3/SmallSettings-0.2.2-py3.3.egg" }, { "comment_text": "", "digests": { "md5": "aba72b0187343c391ebffa0f83b68a6d", "sha256": "40d61408d07d813ad0ccfaaecacbec544f6a90af28493ae733f9c3e3e1e9fc57" }, "downloads": -1, "filename": "SmallSettings-0.2.2.tar.gz", "has_sig": false, "md5_digest": "aba72b0187343c391ebffa0f83b68a6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5042, "upload_time": "2013-12-17T15:23:57", "url": "https://files.pythonhosted.org/packages/84/90/eb3ba4ca9cf986fc2c064d2310632ee0255ef40058b31f99cc14f0f1073c/SmallSettings-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "341805f550357e61b234becedfd07dfb", "sha256": "71b2bc1265c192e2410c0d8506b2180777d88a8c0265e1582dfcad4052224851" }, "downloads": -1, "filename": "SmallSettings-0.2.2-py2.7.egg", "has_sig": false, "md5_digest": "341805f550357e61b234becedfd07dfb", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 15183, "upload_time": "2013-12-20T10:18:28", "url": "https://files.pythonhosted.org/packages/d6/6a/0593841ab4746bdf302be77eb78fe3068ead9de55d87790a121f50752eae/SmallSettings-0.2.2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "319f28b16e2d5568c9a5947f56c703c1", "sha256": "bfd6fe1a98da99c151106c3abe8443814671cd4fd9cd9331d5c768d616d92e83" }, "downloads": -1, "filename": "SmallSettings-0.2.2-py3.3.egg", "has_sig": false, "md5_digest": "319f28b16e2d5568c9a5947f56c703c1", "packagetype": "bdist_egg", "python_version": "3.3", "requires_python": null, "size": 16119, "upload_time": "2013-12-17T15:24:12", "url": "https://files.pythonhosted.org/packages/d2/44/07cf7465f09a11a9f9513af4bebd25e2322078bdcbc678db7257860f63a3/SmallSettings-0.2.2-py3.3.egg" }, { "comment_text": "", "digests": { "md5": "aba72b0187343c391ebffa0f83b68a6d", "sha256": "40d61408d07d813ad0ccfaaecacbec544f6a90af28493ae733f9c3e3e1e9fc57" }, "downloads": -1, "filename": "SmallSettings-0.2.2.tar.gz", "has_sig": false, "md5_digest": "aba72b0187343c391ebffa0f83b68a6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5042, "upload_time": "2013-12-17T15:23:57", "url": "https://files.pythonhosted.org/packages/84/90/eb3ba4ca9cf986fc2c064d2310632ee0255ef40058b31f99cc14f0f1073c/SmallSettings-0.2.2.tar.gz" } ] }