Socket
Book a DemoInstallSign in
Socket

aiohttp-zip-response

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aiohttp-zip-response

A AIOHTTP response class streaming a directory as ZIP archive

2.3.0
pipPyPI
Maintainers
1

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.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.