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.
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
Close
Hashes for aiohttp_zip_response-2.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ee120ab2ac42350fc7d554ce1f1bb44431c1f6b26df2080271ddeae76949e5b |
|
MD5 | 3cf624b16719be3b4aa754def75bc227 |
|
BLAKE2b-256 | a2dd0d64ed1156741a82293001ee2943a8ac257fdf360b1ae34fc7947d5f36a8 |
Close
Hashes for aiohttp_zip_response-2.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72d3d4c9bd13d5529723354d5627708c8f2615a22ac7d060d447cb840c7a158a |
|
MD5 | afc3716c5dc452e0659f48e3c4e3a97f |
|
BLAKE2b-256 | 42f65176ce50df31aeb5f2b4d54d1c5057c61c055c7aaf354fe0dce4bf8044e8 |