{ "info": { "author": "Victor Torres", "author_email": "vpaivatorres@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "python-redis-rate-limit\n=======================\n\n.. image:: https://travis-ci.org/EvoluxBR/python-redis-rate-limit.svg?branch=master\n :target: https://travis-ci.org/EvoluxBR/python-redis-rate-limit\n\n.. image:: https://img.shields.io/pypi/v/python-redis-rate-limit.svg\n :target: https://pypi.python.org/pypi/python-redis-rate-limit\n\n\nThis lib offers an abstraction of a Rate Limit algorithm implemented on top of\nRedis >= 2.6.0.\n\nSupported Python Versions: 2.7, 3.5, 3.6\n\nExample: 10 requests per second\n\n.. code-block:: python\n\n from redis_rate_limit import RateLimit, TooManyRequests\n try:\n with RateLimit(resource='users_list', client='192.168.0.10', max_requests=10):\n return '200 OK'\n except TooManyRequests:\n return '429 Too Many Requests'\n\nExample: 600 requests per minute\n\n.. code-block:: python\n\n from redis_rate_limit import RateLimit, TooManyRequests\n try:\n with RateLimit(resource='users_list', client='192.168.0.10', max_requests=600, expire=60):\n return '200 OK'\n except TooManyRequests:\n return '429 Too Many Requests'\n\nExample: 100 requests per hour\n\n.. code-block:: python\n\n from redis_rate_limit import RateLimit, TooManyRequests\n try:\n with RateLimit(resource='users_list', client='192.168.0.10', max_requests=100, expire=3600):\n return '200 OK'\n except TooManyRequests:\n return '429 Too Many Requests'\n\nExample: you can also setup a factory to use it later\n\n.. code-block:: python\n\n from redis_rate_limit import RateLimiter, TooManyRequests\n limiter = RateLimiter(resource='users_list', max_requests=100, expire=3600)\n try:\n with limiter.limit(client='192.168.0.10'):\n return '200 OK'\n except TooManyRequests:\n return '429 Too Many Requests'\n\nExample: you can also pass an optional Redis Pool\n\n.. code-block:: python\n\n import redis\n from redis_rate_limit import RateLimit, TooManyRequests\n redis_pool = redis.ConnectionPool(host='127.0.0.1', port=6379, db=0)\n try:\n with RateLimit(resource='users_list', client='192.168.0.10', max_requests=10, redis_pool=redis_pool):\n return '200 OK'\n except TooManyRequests:\n return '429 Too Many Requests'\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/evoluxbr/python-redis-rate-limit", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "python-redis-rate-limit", "package_url": "https://pypi.org/project/python-redis-rate-limit/", "platform": "", "project_url": "https://pypi.org/project/python-redis-rate-limit/", "project_urls": { "Homepage": "https://github.com/evoluxbr/python-redis-rate-limit" }, "release_url": "https://pypi.org/project/python-redis-rate-limit/0.0.7/", "requires_dist": null, "requires_python": "", "summary": "Python Rate Limiter based on Redis.", "version": "0.0.7" }, "last_serial": 4784309, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "8b048fa879109e3431bd9fd9ed03ec82", "sha256": "8dd7315c247cf3accd6202a21a68888482e92e4656ff4bebe41e95660cdc2591" }, "downloads": -1, "filename": "python-redis-rate-limit-0.0.1.tar.gz", "has_sig": false, "md5_digest": "8b048fa879109e3431bd9fd9ed03ec82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2839, "upload_time": "2016-07-25T20:06:22", "url": "https://files.pythonhosted.org/packages/4a/2a/da3087541bdf1ab960c9b36fb9bf23ddd147c1dd085e05be3f5fc15d72c2/python-redis-rate-limit-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "7e61be0c1038977f8ba5b1b5d34faa59", "sha256": "e7e0875d1d0d0e6930bf23e936de788783d43ee9e28cfa5e79c706e4b8f87c1a" }, "downloads": -1, "filename": "python-redis-rate-limit-0.0.2.tar.gz", "has_sig": false, "md5_digest": "7e61be0c1038977f8ba5b1b5d34faa59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3035, "upload_time": "2017-11-17T12:24:32", "url": "https://files.pythonhosted.org/packages/c8/35/d6104a29f92909657b379976841634ec87bba65ad5f4eaeaef45c03ca3df/python-redis-rate-limit-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "f755d750d0c2287ed171c20200877c52", "sha256": "247d34e9b556252dabb9f0720ea863f6c276cb02c2fa23af87e94d13049427c5" }, "downloads": -1, "filename": "python-redis-rate-limit-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f755d750d0c2287ed171c20200877c52", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3047, "upload_time": "2017-11-20T17:00:46", "url": "https://files.pythonhosted.org/packages/51/3d/e00643cb36f286d40567eb758009540014dce452c7c12af35a363ca265b4/python-redis-rate-limit-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "474cc521639dc4d50128b99d0619be5d", "sha256": "9789044478a2161b70893486b0ddc0d1d4dfc9ee38be81b639670408f165a7b5" }, "downloads": -1, "filename": "python-redis-rate-limit-0.0.4.tar.gz", "has_sig": false, "md5_digest": "474cc521639dc4d50128b99d0619be5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3378, "upload_time": "2017-11-30T13:07:34", "url": "https://files.pythonhosted.org/packages/2e/4a/013f5587deb46b288252aaa7b9ec2e519386e90e0afc93bc9133875a397e/python-redis-rate-limit-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "26bf34fdcbe659e964d8f994e9ddc247", "sha256": "5592616372f89aa3aca2d95fe793fcc56c90c5ab7555a02ffe0a4a8f1c340de5" }, "downloads": -1, "filename": "python-redis-rate-limit-0.0.5.tar.gz", "has_sig": false, "md5_digest": "26bf34fdcbe659e964d8f994e9ddc247", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3411, "upload_time": "2017-12-11T12:27:48", "url": "https://files.pythonhosted.org/packages/4d/f0/71d68031a1323c59e83ac487d9e52ac762880bab398344dd0154b909bec8/python-redis-rate-limit-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "2514c9011b997726e8c9cd72ceab40fe", "sha256": "f3e9ef020e73793d9b5b109c57615effaf589106606fa2b008e2d6e6607dd4aa" }, "downloads": -1, "filename": "python-redis-rate-limit-0.0.6.tar.gz", "has_sig": false, "md5_digest": "2514c9011b997726e8c9cd72ceab40fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3586, "upload_time": "2018-03-11T23:46:38", "url": "https://files.pythonhosted.org/packages/db/2e/fbd865111532c30a29dd81cd25663b120320654a885d239db20a3ec57f07/python-redis-rate-limit-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "52044d655e730a753aea8840102e9db7", "sha256": "d8d8cf59b1c7509e51addeea9541a272a8e6e73dd3ad41208b3badcc9a7c5d79" }, "downloads": -1, "filename": "python-redis-rate-limit-0.0.7.tar.gz", "has_sig": false, "md5_digest": "52044d655e730a753aea8840102e9db7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3642, "upload_time": "2019-02-05T23:19:38", "url": "https://files.pythonhosted.org/packages/b3/c5/b2b741d493a73ab999cf99a00daab8a53ccd2e84e627022058ad478f4109/python-redis-rate-limit-0.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "52044d655e730a753aea8840102e9db7", "sha256": "d8d8cf59b1c7509e51addeea9541a272a8e6e73dd3ad41208b3badcc9a7c5d79" }, "downloads": -1, "filename": "python-redis-rate-limit-0.0.7.tar.gz", "has_sig": false, "md5_digest": "52044d655e730a753aea8840102e9db7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3642, "upload_time": "2019-02-05T23:19:38", "url": "https://files.pythonhosted.org/packages/b3/c5/b2b741d493a73ab999cf99a00daab8a53ccd2e84e627022058ad478f4109/python-redis-rate-limit-0.0.7.tar.gz" } ] }