{ "info": { "author": "Mantas Zimnickas", "author_email": "sirexas@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout :: Recipe", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development" ], "description": ".. image:: https://travis-ci.org/sirex/exportrecipe.svg\r\n :target: https://travis-ci.org/sirex/exportrecipe\r\n\r\n.. image:: https://coveralls.io/repos/sirex/exportrecipe/badge.svg\r\n :target: https://coveralls.io/r/sirex/exportrecipe\r\n\r\n.. image:: https://pypip.in/d/exportrecipe/badge.svg\r\n :target: https://pypi.python.org/pypi/exportrecipe/\r\n\r\n.. image:: https://pypip.in/v/exportrecipe/badge.svg\r\n :target: https://pypi.python.org/pypi/exportrecipe/\r\n\r\n.. image:: https://pypip.in/license/exportrecipe/badge.svg\r\n :target: https://pypi.python.org/pypi/exportrecipe/\r\n\r\n----\r\n\r\nThis is a Buildout recipe, that can export buildout configuration to JSON file.\r\nLater this exported file can be used to get exported settings and use them in\r\nyour project.\r\n\r\nBuildout provides extensive functionality for managing configuration, but does\r\nnot have tools to use this configuration anywhere else outside Buildout itself.\r\nThis recipe exports all settings to JSON file, allowing to use configuration\r\nparameters outside Buildout.\r\n\r\n\r\nUsage\r\n=====\r\n\r\n.. code-block:: cfg\r\n\r\n [buildout]\r\n parts = settings\r\n\r\n [settings]\r\n recipe = exportrecipe\r\n website-url = http://example.com/\r\n\r\nThis will generate ``settings.json`` file in your buildout directory with following content:\r\n\r\n.. code-block:: json\r\n\r\n {\r\n \"website-url\": \"http://localhost:8000/\"\r\n }\r\n\r\n``exportrecipe`` will export all parameters from recipe's section, except\r\n``recipe`` parameter.\r\n\r\nNow you can use this file for example in your ``settings.py``:\r\n \r\n.. code-block:: python\r\n\r\n import json\r\n\r\n with open('settings.json') as f:\r\n settings = json.load(f)\r\n\r\n WEBSITE_URL = settings['website-url']\r\n\r\nAlso you can use a helper:\r\n\r\n.. code-block:: python\r\n\r\n import exportrecipe\r\n\r\n config = exportrecipe.load('settings.json')\r\n\r\n WEBSITE_URL = config.website_url\r\n\r\nIt is possible to change destination of exported file using ``destination``\r\noption:\r\n\r\n.. code-block:: cfg\r\n\r\n [buildout]\r\n parts = settings\r\n\r\n [settings]\r\n recipe = exportrecipe\r\n destination = somewhereelse.json\r\n website-url = http://example.com/\r\n\r\nThis will generate ``somewhereelse.json`` file with following content:\r\n\r\n.. code-block:: json\r\n\r\n {\r\n \"destination\": \"somewhereelse.json\",\r\n \"website-url\": \"http://localhost:8000/\"\r\n }\r\n\r\nChange History\r\n**************\r\n\r\n0.2 (2015-05-17)\r\n================\r\n\r\n- Initial public release.", "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/sirex/exportrecipe", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "exportrecipe", "package_url": "https://pypi.org/project/exportrecipe/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/exportrecipe/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/sirex/exportrecipe" }, "release_url": "https://pypi.org/project/exportrecipe/0.2/", "requires_dist": null, "requires_python": null, "summary": "Buildout recipe to export buildout configuration to JSON file.", "version": "0.2" }, "last_serial": 1553329, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "9f28cfa8e193aca50a292cfe81947ca5", "sha256": "d8fc39ea010328a86bebf0c5587c0c757e4e0412dec6d673c97a916948b1888c" }, "downloads": -1, "filename": "exportrecipe-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9f28cfa8e193aca50a292cfe81947ca5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4588, "upload_time": "2015-05-17T13:29:14", "url": "https://files.pythonhosted.org/packages/ad/79/43a168f8c25af9592b4da4d48481901d4537c3d8c4a032e7ae061a2c6f72/exportrecipe-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dda09f4a7fdfc009ec84e8890981282d", "sha256": "02662a08c91e079425255e34a402e64126c1743a06582253f9989cec3fd5dc33" }, "downloads": -1, "filename": "exportrecipe-0.2.tar.gz", "has_sig": false, "md5_digest": "dda09f4a7fdfc009ec84e8890981282d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2737, "upload_time": "2015-05-17T13:29:17", "url": "https://files.pythonhosted.org/packages/41/d1/536c74151bbc25eebb4e11c1521ed33c7f8e81c7e9c9ac8239d751442bb2/exportrecipe-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9f28cfa8e193aca50a292cfe81947ca5", "sha256": "d8fc39ea010328a86bebf0c5587c0c757e4e0412dec6d673c97a916948b1888c" }, "downloads": -1, "filename": "exportrecipe-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9f28cfa8e193aca50a292cfe81947ca5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4588, "upload_time": "2015-05-17T13:29:14", "url": "https://files.pythonhosted.org/packages/ad/79/43a168f8c25af9592b4da4d48481901d4537c3d8c4a032e7ae061a2c6f72/exportrecipe-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dda09f4a7fdfc009ec84e8890981282d", "sha256": "02662a08c91e079425255e34a402e64126c1743a06582253f9989cec3fd5dc33" }, "downloads": -1, "filename": "exportrecipe-0.2.tar.gz", "has_sig": false, "md5_digest": "dda09f4a7fdfc009ec84e8890981282d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2737, "upload_time": "2015-05-17T13:29:17", "url": "https://files.pythonhosted.org/packages/41/d1/536c74151bbc25eebb4e11c1521ed33c7f8e81c7e9c9ac8239d751442bb2/exportrecipe-0.2.tar.gz" } ] }