Skip to main content

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)

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.2.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiohttp-compress-0.2.1.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.2.1.tar.gz
Algorithm Hash digest
SHA256 915a66e06d142a465850686afce6c282f351ce732744a60131550b4b5d2b6851
MD5 fdced41b87cac04ccb64ada226787272
BLAKE2b-256 4f42b8a4d96e281c78d8b911358be850ff785115f565c6233469cb921b314f85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiohttp_compress-0.2.1-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.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19008a2a960499c3f209756d5bcd788868dc411d6c491fd1f63a0d18c916a4f8
MD5 bbbf7f48d1fa516aaa85570150cd25c0
BLAKE2b-256 5e376c6396de6ca74135f6ec17c52f37bc4912593bed60df075e7f3af7faea15

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page