{ "info": { "author": "Optic", "author_email": "acunniffe@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# Optic for Flask \n\n## Optic Proxy Setup\nPython APIs built on top of Flask are easy to connect to Optic using our custom middleware. In this tutorial we'll show you how to connect the Optic Documenting Middleware to your Flask app so that your integration tests document your code as they execute. \n\n## Add the Middleware to your Project\nInstall the Optic Documenting Middleware using pip\n```bash\npip3 install optic-document-flask\n``` \n\n### Making the Middleware Run During Testing\nNow add the middleware to your Flask App. Since we only want the middleware to run while Optic executes your tests, make sure you wrap it in a check for the `OPTIC_SERVER_LISTENING` environment variable.\n\nWe like performing this check within the block where we setup our test config, but you can do it anywhere that makes sense for your app. \n```python\nfrom optic import OpticDocumentingMiddleware\n\ndef create_app(test_config=None):\n\n # Setup Code...\n\n if test_config is None:\n # load the instance config, if it exists, when not testing\n app.config.from_pyfile('config.py', silent=True)\n else:\n if 'OPTIC_SERVER_LISTENING' in os.environ:\n OpticDocumentingMiddleware(app)\n app.config.update(test_config)\n return app\n``` \n\n## Using the Proxy Fixture\nThe Documenting middleware will document all the requests/responses that your tests run. Since it is integrated at the middleware level there's no need to update any of your tests files or fixtures. \n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/opticdev/api-ingestion", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "optic-document-flask", "package_url": "https://pypi.org/project/optic-document-flask/", "platform": "", "project_url": "https://pypi.org/project/optic-document-flask/", "project_urls": { "Homepage": "https://github.com/opticdev/api-ingestion" }, "release_url": "https://pypi.org/project/optic-document-flask/0.1.3/", "requires_dist": [ "flask" ], "requires_python": "", "summary": "Document a flask API with Optic", "version": "0.1.3" }, "last_serial": 4997736, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e491d6326dcb3120d85ff5a4b32fa341", "sha256": "a9a64b825445fffd2a5cc7d14ab44c2f44d1f054c312f8d4d35a6528cd469129" }, "downloads": -1, "filename": "optic_document_flask-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e491d6326dcb3120d85ff5a4b32fa341", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4054, "upload_time": "2019-03-27T22:01:50", "url": "https://files.pythonhosted.org/packages/c4/c5/d197047b8683a63fd517e3a16287ab8dec3352bbac61537115cb82b1054f/optic_document_flask-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9b074d73307d6d31344487fe49dcbbed", "sha256": "f51ac110966a192015a5916790a0c6c3f35d6b9f87effb54a3f09b90939729f2" }, "downloads": -1, "filename": "optic-document-flask-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9b074d73307d6d31344487fe49dcbbed", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3183, "upload_time": "2019-03-27T22:01:52", "url": "https://files.pythonhosted.org/packages/5d/ef/7cf1261677000c6bd756c6b23e85edc792cef2e5643927b6a3b07a5ae242/optic-document-flask-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "711ed5c32ddcb9603d697e2b3a697b4d", "sha256": "974dfd1f4797e843ddcf90aa2315243604be38277010b46348f1e7dbc66a53bb" }, "downloads": -1, "filename": "optic_document_flask-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "711ed5c32ddcb9603d697e2b3a697b4d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3462, "upload_time": "2019-03-27T22:10:03", "url": "https://files.pythonhosted.org/packages/a7/47/6e3f0c12cc4e958b18219ad11979bc0196588befccf47dad8444c6e459a9/optic_document_flask-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e053b9d36beb0ab247d22390341ec35c", "sha256": "71de2472e01f8ec0777a0ee0e0dfb7f63f44103f9ac6425dbd727346dd7cba8a" }, "downloads": -1, "filename": "optic-document-flask-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e053b9d36beb0ab247d22390341ec35c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2439, "upload_time": "2019-03-27T22:10:04", "url": "https://files.pythonhosted.org/packages/f5/a6/6255f2266927460622b5c9472aaba8ae2993c8cbb53513f0a84a81f17076/optic-document-flask-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "5cc982ae927a6f33eb5c315cd6a27b45", "sha256": "7d9fd4bd3be44abe02d36d943c907b005764a136f84ee81b148c1e700dd2c2f5" }, "downloads": -1, "filename": "optic_document_flask-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5cc982ae927a6f33eb5c315cd6a27b45", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3442, "upload_time": "2019-03-27T23:50:34", "url": "https://files.pythonhosted.org/packages/18/5f/4090ab80cdd10267303ca6d06dbd83e79ec6223f38b661cc580b236d7ddd/optic_document_flask-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "49680ac84155b22ef5d30bd64ebb4e86", "sha256": "c89b2824491f33e7bd48ea4a56f1948d3eca3290f9b6c8b6d9bc68825d01ceff" }, "downloads": -1, "filename": "optic-document-flask-0.1.2.tar.gz", "has_sig": false, "md5_digest": "49680ac84155b22ef5d30bd64ebb4e86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2414, "upload_time": "2019-03-27T23:50:37", "url": "https://files.pythonhosted.org/packages/0a/b5/89f855df9d4f6fc328ca5520ef50a95eff7229a5eb76b1ed5c2ee173288f/optic-document-flask-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "e37cb6fbf8df994cd7eb508165e27a05", "sha256": "c6de2a63167dee712ca2f43d4e3b9d7804227f9f36bcfa949389bb5dadb8e8f9" }, "downloads": -1, "filename": "optic_document_flask-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "e37cb6fbf8df994cd7eb508165e27a05", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3457, "upload_time": "2019-03-28T13:28:14", "url": "https://files.pythonhosted.org/packages/05/63/d05daa0d8d01519016986e738ae02efdc172dd6848e26026e463d7469d9c/optic_document_flask-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a347a4b445409dea817fb4a5290fcaa", "sha256": "ca9bfe37a6c6f9b7981d053f9ed342a9c97eade372c8b6e6142a9ba4cc74b81e" }, "downloads": -1, "filename": "optic-document-flask-0.1.3.tar.gz", "has_sig": false, "md5_digest": "0a347a4b445409dea817fb4a5290fcaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2440, "upload_time": "2019-03-28T13:28:15", "url": "https://files.pythonhosted.org/packages/1c/21/d61b7674d9203bf47c7b9554e852d3b25776a8f674c21a82de0d266228a3/optic-document-flask-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e37cb6fbf8df994cd7eb508165e27a05", "sha256": "c6de2a63167dee712ca2f43d4e3b9d7804227f9f36bcfa949389bb5dadb8e8f9" }, "downloads": -1, "filename": "optic_document_flask-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "e37cb6fbf8df994cd7eb508165e27a05", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3457, "upload_time": "2019-03-28T13:28:14", "url": "https://files.pythonhosted.org/packages/05/63/d05daa0d8d01519016986e738ae02efdc172dd6848e26026e463d7469d9c/optic_document_flask-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0a347a4b445409dea817fb4a5290fcaa", "sha256": "ca9bfe37a6c6f9b7981d053f9ed342a9c97eade372c8b6e6142a9ba4cc74b81e" }, "downloads": -1, "filename": "optic-document-flask-0.1.3.tar.gz", "has_sig": false, "md5_digest": "0a347a4b445409dea817fb4a5290fcaa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2440, "upload_time": "2019-03-28T13:28:15", "url": "https://files.pythonhosted.org/packages/1c/21/d61b7674d9203bf47c7b9554e852d3b25776a8f674c21a82de0d266228a3/optic-document-flask-0.1.3.tar.gz" } ] }