{ "info": { "author": "Rapha\u00ebl Barrois", "author_email": "raphael.barrois+throttle@polytechnique.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "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", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "throttle\n========\n\nThe throttle library provides a robust and versatile throttling mechanism for Python.\n\nIt can be used in multiple environments, from a single thread to a distributed\nserver cluster.\n\n\nIt supports Python versions 2.6 to 3.3.\n\n\nUsage\n-----\n\nIn order to perform throttling tasks, simply use the :meth:`~throttle.throttle`\nfunction:\n\n.. code-block:: python\n\n import throttle\n\n def some_fun(uid):\n if not throttle.check(key=uid, rate=30, size=10):\n raise ThrottleError()\n # Do the job\n\n\nAlgorithm\n---------\n\nthrottle uses the \"token bucket\" algorithm: for each key, a virtual bucket\nexists.\n\nWhenever a new request gets in, the algorithm performs the following actions:\n\n- Test if adding the request's cost to the bucket would exceed its capacity;\n in that case, return False\n- Otherwise, add the request's cost to the bucket, and return True\n\nSimultaneously, the bucket's current value is decremented at the chosen rate.\n\n\nThis allows for temporary bursts and average computations.\n\n\nInstalling\n----------\n\nFrom pip (https://pypi.python.org/pypi/throttle):\n\n.. code-block:: sh\n\n $ pip install throttle\n\n\nFrom Github:\n\n.. code-block:: sh\n\n $ git clone git://github.com/rbarrois/throttle.git\n", "description_content_type": null, "docs_url": null, "download_url": "http://pypi.python.org/pypi/throttle/", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/rbarrois/throttle", "keywords": "throttle,rate limit,token bucket,leaky bucket", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "throttle-memcache", "package_url": "https://pypi.org/project/throttle-memcache/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/throttle-memcache/", "project_urls": { "Download": "http://pypi.python.org/pypi/throttle/", "Homepage": "http://github.com/rbarrois/throttle" }, "release_url": "https://pypi.org/project/throttle-memcache/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "A robust and versatile throttling implementation relying on the token bucket algorithm.", "version": "0.1.5" }, "last_serial": 1995485, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "83232a74dfc42ca980b087a6c7d21cc9", "sha256": "3130d1635858bcc41f9c25e6df024210101922b261b7cbcb8f8de30022e7f005" }, "downloads": -1, "filename": "throttle-memcache-0.1.1.tar.gz", "has_sig": false, "md5_digest": "83232a74dfc42ca980b087a6c7d21cc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4399, "upload_time": "2016-03-02T16:00:03", "url": "https://files.pythonhosted.org/packages/e3/92/0c654212e90981431e51498397504fcf2a1ee3673fd5d94271a1151fefb6/throttle-memcache-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "3376bdae24e295d7253f68f7a788d099", "sha256": "71ae7df91055f1ba470a761ee40dbef5ca9e286762c122a4af0b20763af4b597" }, "downloads": -1, "filename": "throttle-memcache-0.1.2.tar.gz", "has_sig": false, "md5_digest": "3376bdae24e295d7253f68f7a788d099", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6246, "upload_time": "2016-03-02T16:25:14", "url": "https://files.pythonhosted.org/packages/54/69/ea1f13dd15e541f3a37f8833816ea0bb7a8e663d591d49a356d273aea299/throttle-memcache-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "6ea5dc2d419a18dfcc30ea8ebce77915", "sha256": "4e87cdf16f3d39702f9187bd89c8597aee2440dfdafb13fdc2cf0957fa738da8" }, "downloads": -1, "filename": "throttle-memcache-0.1.3.tar.gz", "has_sig": false, "md5_digest": "6ea5dc2d419a18dfcc30ea8ebce77915", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6265, "upload_time": "2016-03-07T12:48:47", "url": "https://files.pythonhosted.org/packages/76/27/3e8232e9c1a5f23c20ba655572f314a025ee8796a60e2bef023b95db5f6b/throttle-memcache-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "7adb801c2dae6db28812a0fc92c5b63f", "sha256": "bd4b1afed341aca264ed48fdc7637f87824d137298cfd624f5f82b0b19368500" }, "downloads": -1, "filename": "throttle-memcache-0.1.4.tar.gz", "has_sig": false, "md5_digest": "7adb801c2dae6db28812a0fc92c5b63f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5576, "upload_time": "2016-03-07T12:50:55", "url": "https://files.pythonhosted.org/packages/d9/f3/148cca690133357ec0b621f1ab4b02250df21c7580f221080927eed1c901/throttle-memcache-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "a462b5ece20cfefacc1ae03b1f820003", "sha256": "48018dd390b0fe0d9b08cc0025249e6e8e9eec1c61929052938f1ce8a5994c41" }, "downloads": -1, "filename": "throttle-memcache-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a462b5ece20cfefacc1ae03b1f820003", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5634, "upload_time": "2016-03-08T13:04:29", "url": "https://files.pythonhosted.org/packages/cc/92/5d28d90a8e0ed03a09ff125bacc382afc32c1e5786b1b0d4cd76cec083c3/throttle-memcache-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a462b5ece20cfefacc1ae03b1f820003", "sha256": "48018dd390b0fe0d9b08cc0025249e6e8e9eec1c61929052938f1ce8a5994c41" }, "downloads": -1, "filename": "throttle-memcache-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a462b5ece20cfefacc1ae03b1f820003", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5634, "upload_time": "2016-03-08T13:04:29", "url": "https://files.pythonhosted.org/packages/cc/92/5d28d90a8e0ed03a09ff125bacc382afc32c1e5786b1b0d4cd76cec083c3/throttle-memcache-0.1.5.tar.gz" } ] }