Skip to main content

A AIOHTTP response class streaming a directory as ZIP archive

Project description

AIOHTTP ZIP Response

Versions PyPI Codecov License

A AIOHTTP response class streaming the contents of a directory as a ZIP archive. Thanks to stream-zip, this works without storing the entire ZIP in memory or disk.

Generally, this package is meant to complement the existing aiohttp.web.FileResponse class which can be used to stream the contents of a single file.

Installation

pip install aiohttp-zip-response

Usage

from aiohttp import web
from aiohttp_zip_response import ZipResponse


async def handle_zip(request):
    return ZipResponse('path/to/directory')


app = web.Application()
app.router.add_get('/zip', handle_zip)
web.run_app(app)

Caveats

  • The Content-Length header is not set because the size of the ZIP archive is not known in advance. This means clients such as browsers cannot display a download progress bar.
  • This package currently doesn't support streaming of symbolic links to directories.

Download files

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

Source Distribution

aiohttp_zip_response-2.4.0.tar.gz (118.6 kB view details)

Uploaded Source

Built Distribution

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

aiohttp_zip_response-2.4.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file aiohttp_zip_response-2.4.0.tar.gz.

File metadata

  • Download URL: aiohttp_zip_response-2.4.0.tar.gz
  • Upload date:
  • Size: 118.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.3

File hashes

Hashes for aiohttp_zip_response-2.4.0.tar.gz
Algorithm Hash digest
SHA256 f7bb95ce82407e778aacf7e88ac7fef98df37ccec73a90a2305f8973f019c6a4
MD5 f4a79485205f6ce9f26ffb54f9d99b5f
BLAKE2b-256 812ebb507bb022868f2d452692eaa1d76bb265a231b34842c772cc51650d49ee

See more details on using hashes here.

File details

Details for the file aiohttp_zip_response-2.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aiohttp_zip_response-2.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6345c806741af922aff989da0b4b00be5c64af638f8831e0b2857fdeeb85dda
MD5 456d19bcc34f2f68cb7a8d38564bd50f
BLAKE2b-256 76aaca0c896ae2f05d1dbaf7d1e399981fff90291ec8e3e6394f763390a904be

See more details on using hashes here.

Supported by

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