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-Lengthheader 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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7bb95ce82407e778aacf7e88ac7fef98df37ccec73a90a2305f8973f019c6a4
|
|
| MD5 |
f4a79485205f6ce9f26ffb54f9d99b5f
|
|
| BLAKE2b-256 |
812ebb507bb022868f2d452692eaa1d76bb265a231b34842c772cc51650d49ee
|
File details
Details for the file aiohttp_zip_response-2.4.0-py3-none-any.whl.
File metadata
- Download URL: aiohttp_zip_response-2.4.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6345c806741af922aff989da0b4b00be5c64af638f8831e0b2857fdeeb85dda
|
|
| MD5 |
456d19bcc34f2f68cb7a8d38564bd50f
|
|
| BLAKE2b-256 |
76aaca0c896ae2f05d1dbaf7d1e399981fff90291ec8e3e6394f763390a904be
|