Skip to content

This module is the simplest way to enable compression support for aiohttp server applications globally.

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.md
Notifications You must be signed in to change notification settings

mosquito/aiohttp-compress

Repository files navigation

aiohttp-compress

PyPI - License Wheel PyPI PyPI Coverage Status tox

This module is the simplest way to enable compression support for aiohttp server applications globally.

Installation

pip install aiohttp-compress

Example

from aiohttp import web
from aiohttp_compress import compress_middleware


async def handle(request):
    name = request.match_info.get(
        'name', "Anonymous"
    )
    text = "Hello, " + name
    return web.Response(text=text)


app = web.Application()
app.middlewares.append(compress_middleware)
app.add_routes([
    web.get('/', handle),
    web.get('/{name}', handle)
])


if __name__ == '__main__':
    web.run_app(app)

About

This module is the simplest way to enable compression support for aiohttp server applications globally.

Topics

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages