{ "info": { "author": "Andrey Rusanov", "author_email": "andrey@rusanov.me", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "just another settings\n~~~~~~~~~~~~~~~~~~~~~\n\nJust a code I use in a few Bottle/Flask-based and a few other projects.\n\n.. code:: python\n\n from just_another_settings import EnvSelector, EnvField\n\n class BaseSettings(object):\n DEBUG = True\n # EnvField looks for the variable and fetches it, otherwise use value from default parameter\n MONGOLAB_URL = EnvField('MONGO_URL')\n HOST = EnvField('HOST', default='localhost')\n\n\n class ProdSettings(BaseSettings):\n DEBUG = False\n HOST = 'example.com'\n\n\n class DevSettings(BaseSettings):\n pass\n\n\n # env selector - selects settings base on env values\n env_selector = EnvSelector('APP_MODE', 'dev', dev=DevSettings(), prod=ProdSettings())\n\n # value selector - selects settings base on passed(to the `choose` method) value\n by_value_selector = ValueSelector(dev=DevSettings(), prod=ProdSettings())\n\n # somewhere in main file:\n # env\n application.config.from_object(env_selector.choose())\n # by value\n application.config.from_object(by_value_selector.choose('dev'))", "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/andreyrusanov/just-another-settings", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "just-another-settings", "package_url": "https://pypi.org/project/just-another-settings/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/just-another-settings/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/andreyrusanov/just-another-settings" }, "release_url": "https://pypi.org/project/just-another-settings/1.0/", "requires_dist": null, "requires_python": null, "summary": "Small lib to manage settings as object for Flask/Bottle/custom apps", "version": "1.0" }, "last_serial": 1996028, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "4ef879653ce0a446367f3216f2f43cec", "sha256": "f60572f43f2130a53e93e1eda4da03f5fd528407502ac77ef4e352c6bf4d4af2" }, "downloads": -1, "filename": "just-another-settings-1.0.tar.gz", "has_sig": false, "md5_digest": "4ef879653ce0a446367f3216f2f43cec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2166, "upload_time": "2016-03-08T18:19:25", "url": "https://files.pythonhosted.org/packages/59/cc/e6ac48a5612de702c65b60b03e447d689f1fa729b75e0ad0c22eb78a38a4/just-another-settings-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4ef879653ce0a446367f3216f2f43cec", "sha256": "f60572f43f2130a53e93e1eda4da03f5fd528407502ac77ef4e352c6bf4d4af2" }, "downloads": -1, "filename": "just-another-settings-1.0.tar.gz", "has_sig": false, "md5_digest": "4ef879653ce0a446367f3216f2f43cec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2166, "upload_time": "2016-03-08T18:19:25", "url": "https://files.pythonhosted.org/packages/59/cc/e6ac48a5612de702c65b60b03e447d689f1fa729b75e0ad0c22eb78a38a4/just-another-settings-1.0.tar.gz" } ] }