Skip to main content

Async unzipping to prevent asyncio timeout errors and decrease the memory usage for bigger zip files

Project description

async-unzip

Asynchronous unzipping of big files with low memory usage in Python Helps with big zip files unpacking (memory usage + buffer_size could be changed). Also, prevents having Asyncio Timeout errors especially in case of many workers using same CPU cores.

Fully tested on Python 3.7 through 3.14.

By default the extractor schedules up to 4 concurrent workers. Tune concurrency via the max_workers argument:

asyncio.run(unzip('archive.zip', path='output', max_workers=8))

When uvloop is installed, the event loop policy switches automatically to leverage its faster reactor.

When python-isal is installed, async-unzip automatically switches to its faster zlib-compatible decompressor; otherwise it falls back to the standard library zlib.

From version 0.3.6 module doesn't require, but expects to have aiofile OR aiofiles to be installed for I/O operations. However, aiofile is recommended for linux, just don't forget to install libaio (libaio1) linux module (e.g., apt install -y libaio1 for debian)

from async_unzip.unzipper import unzip
import asyncio

asyncio.run(unzip('tests/test_files/fixture_beta.zip', path='some_dir'))

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

async_unzip-0.4.5.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

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

async_unzip-0.4.5-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file async_unzip-0.4.5.tar.gz.

File metadata

  • Download URL: async_unzip-0.4.5.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for async_unzip-0.4.5.tar.gz
Algorithm Hash digest
SHA256 95307f0012a0e778c3ccd375fa43cee5ab1efe503dfb17717d4afb5108c5d2a1
MD5 b8950e608ae1db1147875ee81dcf3571
BLAKE2b-256 93c7a9156a1134de0efe425ea9ded219fbdee78b1230cca0cc81623554db01f9

See more details on using hashes here.

File details

Details for the file async_unzip-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: async_unzip-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for async_unzip-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ae5dc059fc6e58110236a679a8bfbebf98f1c758c8b260610b2d559a7db2d33a
MD5 308ec83cb788ef0d2bf25ee8610d6c20
BLAKE2b-256 9242870b662195093c81ead50d8d5eb1d1a8ab95a5586e31f2e1f629d6290d8f

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