A simple ratelimiter for aiohttp.web
Project description
aiohttp-ratelimiter
This library allows you to add a rate limit to your aiohttp.web app.
Install from git
python -m pip install git+https://github.com/Nebulizer1213/aiohttp-ratelimiter
Install from pypi
python -m pip install aiohttp-ratelimiter
Example
from aiohttplimiter import limit
from aiohttp import web
app = web.Application()
routes = web.RouteTableDef()
# This endpoint can only be requested one time per second per IP address.
@routes.get("/")
@limit(ratelimit="1/1", keyfunc=default_keyfunc)
async def test(request):
return web.Response(text="test")
app.add_routes(routes)
web.run_app(app)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for aiohttp-ratelimiter-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 521e0b6ed2dfcf2969a1a88e8824d54e47e95b836fafdbecf30b1d7995db9b6b |
|
MD5 | ea63fe3dafb45652b7fc16b82eb0b1b6 |
|
BLAKE2b-256 | e0c9dce05022469392eee694d12cc67c1b63cbb0ccce3e724b22db1417fdd278 |