{ "info": { "author": "Daniel Grossmann-Kavanagh", "author_email": "me@danielgk.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Flask-Batch\n===========\n\n|Travis CI build status| |GitHub license| |Latest Version|\n\n*Batch multiple requests at the http layer.* Flask-Batch is inpsired by\n`how google cloud storage does\nbatching `__.\n\nIt adds a ``/batch`` route to your API which can execute batched HTTP\nrequests against your API server side. The client wraps several requests\nin a single request using the ``multipart/mixed`` content type.\n\n\nInstallation\n============\n\n.. code:: bash\n\n pip install Flask-Batch\n\n # to include the dependencies for the batching client\n pip install Flask-Batch[client]\n\n\nGetting Started\n===============\n\nServer\n------\n\n.. code:: python\n\n from flask import Flask\n from flask_batch import add_batch_route\n\n app = Flask(__name__)\n add_batch_route(app)\n\n # that's it!\n\nClient\n------\n\nThe client wraps a requests session.\n\n.. code:: python\n\n from flask_batch.client import Batching\n import json\n\n alice_data = bob_data = {\"example\": \"json\"}\n\n with Batching(\"http://localhost:5000/batch\") as s:\n alice = s.patch(\"/people/alice/\", json=alice_data)\n bob = s.patch(\"/people/bob/\", json=bob_data)\n\n alice # \n alice.json() # {\"response\": \"json\"}\n\nWhy Batch?\n==========\n\nOften the round-trip-time from a client to a server is high. Batching\nrequests reduces the penalty of a high RTT, without the added complexity\nof request parallelization.\n\n.. figure:: sequence-diagram.svg\n :alt: \n\nBatching Done Right\n===================\n\nOften API designers will create custom batch endpoints for specific\noperations. Creating custom API endpoints for performing bulk operations\nusually end up being clunky. Each one ends up unique. This means more\ncode to maintain, and more bugs.\n\nIt can be difficult to reason about bulk json API endpoints. For\nexample, what happens on error? Does the bulk operation fail? continue?\nroll back?\n\nBatching at the HTTP layer results in clear and expected behaviors that\nare easy to reason about. HTTP batching simply behaves the same way as\nall of the individual requests that are sent in the batch.\n\nStatus\n======\n\nThis project is in ``alpha``. I'm hoping to eventually get it approved\nas a flask extension.\n\n.. |Travis CI build status| image:: https://api.travis-ci.org/dtkav/flask-batch.svg?branch=master\n :target: https://travis-ci.org/dtkav/flask-batch/\n.. |GitHub license| image:: https://img.shields.io/github/license/dtkav/flask-batch.svg\n :target: https://github.com/dtkav/flask-batch/blob/master/LICENSE\n.. |Latest Version| image:: https://img.shields.io/pypi/v/flask-batch.svg\n :target: https://pypi.python.org/pypi/flask-batch\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dtkav/flask-batch", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "flask-batch", "package_url": "https://pypi.org/project/flask-batch/", "platform": "", "project_url": "https://pypi.org/project/flask-batch/", "project_urls": { "Homepage": "https://github.com/dtkav/flask-batch" }, "release_url": "https://pypi.org/project/flask-batch/0.0.2/", "requires_dist": null, "requires_python": "", "summary": "", "version": "0.0.2" }, "last_serial": 4236579, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "7e445cee1c7dd82e01ea74032c582983", "sha256": "a2f024695db6e82e95a790736c7251a897c0fef4876b8f0a4d6a13b79299e1c0" }, "downloads": -1, "filename": "flask-batch-0.0.0.tar.gz", "has_sig": false, "md5_digest": "7e445cee1c7dd82e01ea74032c582983", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4510, "upload_time": "2018-08-02T06:49:58", "url": "https://files.pythonhosted.org/packages/e2/89/5a3562585bc75f9844913312a8c7d64f10e057d84e87cd9cc9e099d9beb7/flask-batch-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "714b29db68bff14e92bd7b6b2de11cea", "sha256": "885f05ceb8405b06a67cd833f1cc60bb854586ec8efdf788793e9e411f1367f0" }, "downloads": -1, "filename": "flask-batch-0.0.1.tar.gz", "has_sig": false, "md5_digest": "714b29db68bff14e92bd7b6b2de11cea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8789, "upload_time": "2018-08-14T03:38:02", "url": "https://files.pythonhosted.org/packages/64/96/02b4ace2dfd98f9cb8767b34502265cb3ca7380b65084afc42e2d3d4af44/flask-batch-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "31dfdbce45d879c3dc2090bc25b546a4", "sha256": "c84b51bf8d874d4e1405140e8666a0602551efce0983115a3b1bcaffceefc00a" }, "downloads": -1, "filename": "Flask-Batch-0.0.2.tar.gz", "has_sig": false, "md5_digest": "31dfdbce45d879c3dc2090bc25b546a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7940, "upload_time": "2018-09-04T06:41:37", "url": "https://files.pythonhosted.org/packages/6b/2a/af2c708fd8c115f4b4fb6ad2c85be7f908cfc464e0c56b6c7792b5d31a4d/Flask-Batch-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "31dfdbce45d879c3dc2090bc25b546a4", "sha256": "c84b51bf8d874d4e1405140e8666a0602551efce0983115a3b1bcaffceefc00a" }, "downloads": -1, "filename": "Flask-Batch-0.0.2.tar.gz", "has_sig": false, "md5_digest": "31dfdbce45d879c3dc2090bc25b546a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7940, "upload_time": "2018-09-04T06:41:37", "url": "https://files.pythonhosted.org/packages/6b/2a/af2c708fd8c115f4b4fb6ad2c85be7f908cfc464e0c56b6c7792b5d31a4d/Flask-Batch-0.0.2.tar.gz" } ] }