{ "info": { "author": "Guillaume Gelin", "author_email": "contact@ramnes.eu", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask-Aggregator\n================\n\n.. image:: https://img.shields.io/pypi/v/flask-aggregator.svg\n\nBatch the GET requests to your API into a single POST. Save requests latency and\nreduce REST chatiness.\n\nI was inspired by `this article\n`_\nfrom 3scale, and by `their NGINX aggregator\n`_ - but I wanted something simpler.\n\n\nWhat does it do?\n----------------\n\nFlask-Aggregator adds an endpoint to your Flask application that handles\nmultiple GET requests in a single POST, and returns the response of each GET\nrequest in a JSON stream.\n\n\nWhat does that mean?\n--------------------\n\nIt means that instead of sending multiple GET requests:\n\n.. code-block:: sh\n\n -> GET /route1\n <- answer1\n -> GET /route2\n <- answer2\n -> GET /route3\n <- answer3\n\n\nYou can now just send a single POST that aggregates them all:\n\n.. code-block:: sh\n\n -> POST /aggregate [\"/route1\", \"/route2\", \"/route3\"]\n <- {\n \"/route1\": answer1,\n <- \"/route2\": answer2,\n <- \"/route3\": answer3\n }\n\n\nWhy?\n----\n\nMobile networks.\n\n\nHow to install?\n---------------\n\n.. code-block:: sh\n\n $ pip install flask-aggregator\n\n\nHow to setup my application?\n----------------------------\n\n.. code-block:: python\n\n from flask import Flask\n from flask_aggregator import Aggregator\n\n app = Flask(__name__)\n Aggregator(app=app, endpoint=\"/batch\")\n\n\nHow to aggregate?\n-----------------\n\n.. code-block:: sh\n\n $ python example.py\n [go to another shell]\n $ curl -H \"Content-type: application/json\" -X POST 127.0.0.1:5000/batch \\\n --data-raw '[\"/hello/world\", \"/hello/ramnes?question=Sup?\"]'\n {\n \"/hello/world\": \"Hello, world!\",\n \"/hello/ramnes?question=Sup?\": \"Hello, ramnes! Sup?\"\n }\n\n\nIs it ready for production yet?\n-------------------------------\n\nNot really.\n\nAs of today, Flask-Aggregator executes the aggregated requests in a\nsynchronous manner, which makes it only useful if latency is a real issue and\nresponse time is not, and that more than N requests are sent at the same time,\nwhere N is maximum number of concurrent requests on user's client.\n\nAlso, it has limitations such has:\n\n* no automatic caching mechanism browser-side, since it uses a POST request\n* no header support at all for now, which means no cookie, etag, or whatever\n* no other HTTP verb than GET is supported for now\n\nLast but not least, chances are high that a lot of corner cases are not handled.\n\n\nLicense\n-------\n\nMIT", "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/ramnes/flask-aggregator", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "Flask-Aggregator", "package_url": "https://pypi.org/project/Flask-Aggregator/", "platform": "any", "project_url": "https://pypi.org/project/Flask-Aggregator/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ramnes/flask-aggregator" }, "release_url": "https://pypi.org/project/Flask-Aggregator/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Batch the GET requests to your REST API into a single POST", "version": "0.2.0" }, "last_serial": 2580415, "releases": { "0.1.1": [], "0.1.2": [ { "comment_text": "", "digests": { "md5": "5c5745748e9d8ed30caddf8301f0bce9", "sha256": "40d8f18869fa5c2e1e797625e7961145109213205e9edafb0604c6681a1c64b2" }, "downloads": -1, "filename": "Flask-Aggregator-0.1.2.tar.gz", "has_sig": false, "md5_digest": "5c5745748e9d8ed30caddf8301f0bce9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2891, "upload_time": "2017-01-09T11:12:40", "url": "https://files.pythonhosted.org/packages/d6/fc/4ad93eba644171f9e1ea077665428c0a9389ce1d074257b4b98c0b854299/Flask-Aggregator-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "eed9be6cc0442d4185687ce1c8f9fc93", "sha256": "80cc643beaa9904b0d56bfce22e36cc642d26423fe9137a29b4ff1c549222f9c" }, "downloads": -1, "filename": "Flask-Aggregator-0.2.0.tar.gz", "has_sig": false, "md5_digest": "eed9be6cc0442d4185687ce1c8f9fc93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3273, "upload_time": "2017-01-17T18:54:20", "url": "https://files.pythonhosted.org/packages/b5/2b/4154c6a72e7b03b6dd2eabc489832768cf8aae2610a445df0478c283d620/Flask-Aggregator-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "eed9be6cc0442d4185687ce1c8f9fc93", "sha256": "80cc643beaa9904b0d56bfce22e36cc642d26423fe9137a29b4ff1c549222f9c" }, "downloads": -1, "filename": "Flask-Aggregator-0.2.0.tar.gz", "has_sig": false, "md5_digest": "eed9be6cc0442d4185687ce1c8f9fc93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3273, "upload_time": "2017-01-17T18:54:20", "url": "https://files.pythonhosted.org/packages/b5/2b/4154c6a72e7b03b6dd2eabc489832768cf8aae2610a445df0478c283d620/Flask-Aggregator-0.2.0.tar.gz" } ] }