A AIOHTTP response class streaming a directory as ZIP archive
Project description
AIOHTTP ZIP Response
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.
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
Built Distribution
File details
Details for the file aiohttp_zip_response-2.2.0.tar.gz
.
File metadata
- Download URL: aiohttp_zip_response-2.2.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.11.6-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98d3f2f40334ae609d917a8347a97336ba80a7fb1ede1822ca5f9d0305c18459 |
|
MD5 | 92bbecdc864828a76b28cf4d0f9bacc2 |
|
BLAKE2b-256 | 734039e6c65cb7511badb9ae044eb927e655894d8d91e9c0feb3650606eeea67 |
File details
Details for the file aiohttp_zip_response-2.2.0-py3-none-any.whl
.
File metadata
- Download URL: aiohttp_zip_response-2.2.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.11.6-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c0831d0f15fde0173990fdcc0691a2529b7c8e5fb49227db7e7fdcf154ff462 |
|
MD5 | f97f288ed50987e8a22d3ffb7bf80450 |
|
BLAKE2b-256 | cfdd78a22f5989a64617af5693424ab714fa562cbe610bbbe0f4114bea9c0778 |