Skip to main content

Blazing fast, multi-threaded SIMD ZIP extraction library

Project description

Hayazip

日本語 | English

🚀 Blazing Fast, Multi-Threaded SIMD ZIP Extraction Library for Rust & Python

hayazip is an ultra-fast ZIP archive extraction library designed from the ground up to leverage modern hardware capabilities. It combines memory-mapped I/O, SIMD-accelerated decompression (via libdeflater), and thread-pool-based parallel extraction (via rayon) to achieve up to 10x faster extraction latency compared to the standard Unix unzip utility.

Features

  • Zero-Copy Parsers: Uses memmap2 to map the ZIP file directly into memory, skipping expensive kernel-to-user-space copies.
  • SIMD Optimized Decompression: Powered by libdeflater to leverage AVX2, AVX-512, or NEON depending on the architecture.
  • Multi-threaded Extraction: Uses rayon in a Fork-Join model to decompress and extract independent files in parallel securely.
  • Hardware-accelerated CRC32: Validates integrity using hardware instructions through crc32fast.
  • Cross-platform Python Bindings: Built with PyO3 for easy, out-of-the-box integration in any Python environment.

Python Quick Start

Installation

You can install hayazip directly from PyPI with uv or pip. Prebuilt abi3 wheels are published for CPython 3.8+ on Linux, macOS, and Windows, and a source distribution is published as a fallback:

uv add hayazip
# or
pip install hayazip

Usage

Extracting archives in Python is easy and significantly faster than the standard zipfile module:

import hayazip

archive_path = "huge_archive.zip"
output_dir = "extracted_files"

# Extracts the entire archive fully utilizing all CPU cores
hayazip.extract_zip(archive_path, output_dir)
print("Done!")

Rust Quick Start

Add hayazip to your Cargo.toml:

[dependencies]
hayazip = "0.1.4"

Usage

use hayazip::extract;

fn main() {
    let archive_path = "huge_archive.zip";
    let output_dir = "extracted_files";

    if let Err(e) = extract(archive_path, output_dir) {
        eprintln!("Extraction failed: {}", e);
    } else {
        println!("Extraction successful!");
    }
}

Benchmarks

Extracting a 50MB realistically compressed test archive with 10 files (5MB each):

  • unzip (Unix standard): ~162ms
  • hayazip: ~16ms (10x faster)

Build from Source (Python)

To compile from source and install into your local Python environment:

pip install maturin
maturin develop --release

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

hayazip-0.1.4.tar.gz (16.5 kB view details)

Uploaded Source

Built Distributions

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

hayazip-0.1.4-cp38-abi3-win_amd64.whl (190.2 kB view details)

Uploaded CPython 3.8+Windows x86-64

hayazip-0.1.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (345.9 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

hayazip-0.1.4-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (581.7 kB view details)

Uploaded CPython 3.8+macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file hayazip-0.1.4.tar.gz.

File metadata

  • Download URL: hayazip-0.1.4.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for hayazip-0.1.4.tar.gz
Algorithm Hash digest
SHA256 0701ff80cd33b42a553617a30afed807af2ed19a15a4b2964a42d1d88c318f3e
MD5 483c541c1822d5de396194b3ae2ac0f7
BLAKE2b-256 78c3b00643d18f3d128180fc01c244b78c6a9593790a4add2beada6e3abc00a3

See more details on using hashes here.

File details

Details for the file hayazip-0.1.4-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: hayazip-0.1.4-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 190.2 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.12.6

File hashes

Hashes for hayazip-0.1.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 96a462723ddcd1d26d2a06d6e3f355024d9ce28f9122c853fe5e6e72fa936f71
MD5 2f66d53c54e6ff7668f74bbd9af8e6af
BLAKE2b-256 789f9033e307e0513358e241b7e44cec5a2769d675341aaeeff1d0e0453efb45

See more details on using hashes here.

File details

Details for the file hayazip-0.1.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hayazip-0.1.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d71ebd3b0ba5c8355c91150065e7644c68d74ee8190859fbaa182a3da23991ca
MD5 cf5b131cb3db7ed3a098dd0c90d10c00
BLAKE2b-256 16938d07e6cc1f5e56d71b111fbf85106d0300f85d9bb1fd724e2174878d41f7

See more details on using hashes here.

File details

Details for the file hayazip-0.1.4-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for hayazip-0.1.4-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 d7816145bdbbceadb954e87a7a50767e99ea703ae3e0e5d5850866bcb7fdd113
MD5 a1527cfecc01885149e2308dde9cb62a
BLAKE2b-256 e33a6334ee085dc01b395b853c4272a0221456a1a0e3ed17e67d197ba70e1f61

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