Skip to main content

Blazing fast, multi-threaded SIMD ZIP library

Project description

Hayazip

日本語 | English

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

hayazip is an ultra-fast ZIP archive library designed from the ground up to leverage modern hardware capabilities. It combines memory-mapped I/O, SIMD-accelerated compression and decompression (via libdeflater), and thread-pool-based parallelism (via rayon) to accelerate both ZIP extraction and ZIP creation.

Features

  • Zero-Copy Parsers: Uses memmap2 to map the ZIP file directly into memory, skipping expensive kernel-to-user-space copies.
  • SIMD Optimized Compression and Decompression: Powered by libdeflater to leverage AVX2, AVX-512, or NEON depending on the architecture.
  • Multi-threaded ZIP Creation and Extraction: Uses rayon to process independent files in parallel.
  • Hardware-accelerated CRC32: Validates integrity using hardware instructions through crc32fast.
  • Low-footprint Archive Writing: Spools compressed members to temporary files instead of holding the full archive in memory.
  • 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

Creating and extracting archives in Python is straightforward:

import hayazip

source_dir = "project_files"
archive_path = "project_files.zip"
output_dir = "extracted_files"

hayazip.create_zip(source_dir, archive_path)
hayazip.extract_zip(archive_path, output_dir)
print("Done!")

Rust Quick Start

Add hayazip to your Cargo.toml:

[dependencies]
hayazip = "0.2.0"

Usage

use hayazip::{create_zip, extract};

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

    create_zip(source_dir, archive_path).expect("Archive creation failed");

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

Benchmarks

On modern CPUs, hayazip uses libdeflater for SIMD-accelerated DEFLATE and rayon for parallel file processing. Archive creation writes members with bounded worker parallelism and a temporary spool to keep memory usage predictable while still saturating multiple cores.

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.2.0.tar.gz (22.0 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.2.0-cp38-abi3-win_amd64.whl (253.2 kB view details)

Uploaded CPython 3.8+Windows x86-64

hayazip-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (425.5 kB view details)

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

hayazip-0.2.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (724.6 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.2.0.tar.gz.

File metadata

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

File hashes

Hashes for hayazip-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d5834c47b1849e79f5093410079f73f844779af8b4004efe832eb23e9170bf1a
MD5 9e2605ecefea23a89783a57c0b384bb2
BLAKE2b-256 346a57e67ec4cf3fee76403d3d2e83fc6f1c4b769e98b72bdd3c93b33c628e2b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hayazip-0.2.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 253.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.2.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b26573cfb465dd1766cbe7d32e1a6e086f1fd2279b178a16048fe22be29efa6f
MD5 dede4e4a8198e6c3b89edda298866a8e
BLAKE2b-256 1946bfdcd780c1b1e262904fda34feeee76320cfe6ffb5bb8590f7407e9760ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hayazip-0.2.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e8f61299ea6c5d6ac27b860e3e2e66886609ab1ef9dc70b3a30ba8f241d9308e
MD5 63838b8905b8a26dc2ada2d208fcc61d
BLAKE2b-256 4b4cb10026859e3fb38fba1d0ba8bab969d1d84843e64b247b652b6930d6c1d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hayazip-0.2.0-cp38-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 85b153acd5c13a62dca6b9485e943f93944a8bd6979c5c8ebac551ac97347ec1
MD5 790c4bb8bed555817df0cc9c9248c3dc
BLAKE2b-256 c4e65673e7956098440cf4c6ea9ad85010fd5a28c3e01663405e9b0311a889f1

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