Skip to main content

Fast multithread/multiprocess unzipper

Project description

Fast unzipper

Fast unzipper is a Python CLI tool you could use to effectively and fast unzip ZIP archives.

When will it be helpful?

It proved to be useful working with huge amount of relatively small files for it distributes load among processes and threads to provide higher speeds than standard unzip.

However, should you need to unzip archive with only few files, that tool isn't probably for you because it won't be possible to distribute 1 or 2 files in archive among threads.

Moreover, changing threads(e.g. 8) when there are 8 files will lead to decrease in performance rather than profit in time.

Use it when it's possible to adequately split your files.

Installation

Use the package manager pip to install fast_unzip.

pip install fast_unzip

Usage

Ir's compulsory you specify the archive PATH like this.

MacOS/Linux

python3 -m fast_unzip test.zip

Windows

python -m fast_unzip test.zip

Being started this way it will use standard mode which means it will decide automatically which mode to use depending on compression level of your archive.

Standard directory for unpacking is ./ZIP_unpack. You can specify it with -d flag.

python -m fast_unzip test.zip -d ./../test

Nevertheless, you can specify number of processes and threads you want to start using -p and -t flags.

python3 -m fast_unzip test.zip -p 4 -t 10

Also, you can specify mode you want this tool to work. Maybe you know beforehand that compression level is low. You do it with -m flag.

python -m fast_unzip test.zip -m "mt"

Recommendations

Though, it's possible to choose mode, number of threads and number of processes manually, it's highly unrecommended, because if will affect the performance.

Number of threads is chosen as min(32, os.cpu_count()).

Number of processes is chosen as os.cpu_count().

For some reasons os.cpu_count() can fail to determine your system characteristics. This way you'll be given an error and you need to specify this arguments implicitly. I highly recommend you use formula from above.

If you try to enter more processes than os.cpu_count() found you'll be given an error. You can either choose an appropriate number of processes or leave it to program to decide.

!!! If it's impossible for os.cpu_count() to work and you enter inappropriate number of processes it will lead to undefined behaviour.

If you know that archive you want to unpack is compressed less than 50% you can use -m "cmbd", else -m "mt". It will disable part of program doing analysis and increase performance.

Thank you for using our tool!

License

MIT

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

fast_unzip-0.2.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

fast_unzip-0.2.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file fast_unzip-0.2.0.tar.gz.

File metadata

  • Download URL: fast_unzip-0.2.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.10 Linux/5.15.0-1026-aws

File hashes

Hashes for fast_unzip-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c66c4cd0341786d9c51e49b8e52a469c49402c9916c99e1fd6dc2464e9d61d1d
MD5 e391993590eb9c1ab152641874c905ab
BLAKE2b-256 8e1647616d298491a24240e8b2f9a7673059a56d615221e62b9742c743c428cb

See more details on using hashes here.

File details

Details for the file fast_unzip-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fast_unzip-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.10 Linux/5.15.0-1026-aws

File hashes

Hashes for fast_unzip-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d00966554baeeff247e65698032f0255690b26ffd6cc52fbbbc9b36153497de5
MD5 ed1dfab743a3d29de9b90559a95839dd
BLAKE2b-256 7f1fc85c8e42e95bd9fd5ca81d808e1121c43f228153a1623a042aa64d794982

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