Skip to main content

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

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiohttp-compress-0.1.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

aiohttp_compress-0.1.2-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file aiohttp-compress-0.1.2.tar.gz.

File metadata

  • Download URL: aiohttp-compress-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for aiohttp-compress-0.1.2.tar.gz
Algorithm Hash digest
SHA256 79870c50b3666f2e6e74c2bab250ffebaf2e4f40ac3ed9b5bafaaa185b86a1cd
MD5 430fcf820d69d4613d8f58f86eb0b579
BLAKE2b-256 73592171433adda011a6808558b5f87e6bd12294b3df56e1aeb7ad2a7fbf4673

See more details on using hashes here.

File details

Details for the file aiohttp_compress-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: aiohttp_compress-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for aiohttp_compress-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 efa4b50aa5e65bc4207c800134b19d3141d53e952e584d7189bbda4e2097988e
MD5 5c59babb8e2b307721f1246bdb8f99eb
BLAKE2b-256 c412b598692745a2915897a172ad828e1a85d03c9e071c4d68c2aebaf0e17820

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page