Skip to main content

High-performance snapshot storage library with compression and encryption

Project description

hexz

PyPI Python License

Python library for reading, writing, and streaming Hexz snapshots — a seekable, deduplicated compression format built in Rust.

pip install hexz

Quick Start

Reading snapshots

import hexz

with hexz.open("data.hxz") as reader:
    data = reader.read()           # read entire snapshot
    chunk = reader.read(4096)      # read 4KB from current position
    reader.seek(1024)              # seek to offset
    block = reader[100:200]        # slice notation

Writing snapshots

import hexz

with hexz.open("output.hxz", mode="w", compression="lz4") as writer:
    writer.add_file("disk.img")
    writer.add_bytes(b"extra data")

Building from files

import hexz

# Build with a profile preset (ml, eda, embedded, generic, archival)
metadata = hexz.build("source.img", "output.hxz", profile="ml")

Converting from other formats

import hexz

# Convert tar, HDF5, or WebDataset archives
hexz.convert("dataset.tar", "dataset.hxz")
hexz.convert("data.h5", "data.hxz")       # requires pip install hexz[hdf5]

Remote storage

import hexz

# Stream from S3 (only fetches needed blocks)
reader = hexz.open("s3://bucket/data.hxz", s3_region="us-east-1")
chunk = reader.read(4096)

# HTTP streaming
reader = hexz.open("https://example.com/data.hxz")

API

Core I/O

Function / Class Description
hexz.open(path, mode="r", **opts) Open a snapshot for reading or writing
Reader(path, ...) Read snapshots with file-like interface (seek, read, tell, slice)
AsyncReader.create(path, ...) Async reader for asyncio workflows
Writer(path, ...) Create new snapshots with compression and deduplication

Data operations

Function Description
build(source, output, profile, ...) Build snapshot from files with preset profiles
convert(input, output, format, ...) Convert tar/HDF5/WebDataset to Hexz
inspect(path) Get snapshot metadata (compression, size, block count)
verify(path, ...) Verify integrity and optional cryptographic signature

Array support

Function / Class Description
read_array(source, offset, shape, dtype) Read NumPy array from snapshot
write_array(dest, array, ...) Write NumPy array to snapshot
ArrayView(path, shape, dtype) Memory-mapped array access with slicing

ML integration

Class Description
Dataset(path, ...) PyTorch Dataset with caching and prefetching
from hexz import Dataset
from torch.utils.data import DataLoader

dataset = Dataset("s3://bucket/train.hxz", cache_size_mb=512)
loader = DataLoader(dataset, batch_size=32, num_workers=4, shuffle=True)

for batch in loader:
    train_step(batch)

Cryptographic operations

import hexz

hexz.keygen("private.key", "public.key")   # generate Ed25519 keypair
hexz.sign("snapshot.hxz", "private.key")   # sign a snapshot
hexz.verify("snapshot.hxz", "public.key")  # verify signature

Optional dependencies

pip install hexz[numpy]       # NumPy array support
pip install hexz[torch]       # PyTorch Dataset integration
pip install hexz[hdf5]        # HDF5 conversion (h5py)
pip install hexz[ml]          # NumPy + PyTorch
pip install hexz[full]        # All optional dependencies

Compression

LZ4 is always available. Zstd and S3 streaming are included by default in PyPI wheels.

Algorithm Speed Ratio Default
LZ4 Fast (~2-3 GB/s) Moderate Always included
Zstd Moderate High Yes

Requirements

  • Python 3.8+
  • Linux (x86_64, aarch64), macOS (x86_64, Apple Silicon), or Windows (x86_64)

Links

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

hexz-0.4.3.tar.gz (397.7 kB view details)

Uploaded Source

Built Distributions

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

hexz-0.4.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.2 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

hexz-0.4.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.2 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

hexz-0.4.3-cp38-abi3-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.8+Windows x86-64

hexz-0.4.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.3 MB view details)

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

hexz-0.4.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.2 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

hexz-0.4.3-cp38-abi3-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

hexz-0.4.3-cp38-abi3-macosx_10_12_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file hexz-0.4.3.tar.gz.

File metadata

  • Download URL: hexz-0.4.3.tar.gz
  • Upload date:
  • Size: 397.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hexz-0.4.3.tar.gz
Algorithm Hash digest
SHA256 0fc099e82a137c5ffbc917689f0444170e9521bbf842a9a11e6dde0f222e83a5
MD5 aca4aba3287b7fadbedcd24f238be8e7
BLAKE2b-256 0b15618b214378d0ef132e100289f70f0291f1bdff74cd35ea600da56cdadc2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.4.3.tar.gz:

Publisher: release.yml on hexz-org/hexz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hexz-0.4.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hexz-0.4.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a7595bc4bc21bc001038cff91d889b4aa4f008a15e595b18b9199f5954464b52
MD5 dacd5e4865ec037c1d7d4ea6bd10f04b
BLAKE2b-256 88cb6634b92e9fd54512fe0067ade5555b73602dd34084dc8b9cda94289009f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.4.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on hexz-org/hexz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hexz-0.4.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hexz-0.4.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 549e1b7925ca3ade7f606bc11ed1d6772873f7a9c19b7fcca5abfb6c6d49fba8
MD5 f21d0e4e624d4071bf5a331d904989f4
BLAKE2b-256 e7672a51e632d058bfc576d8b51500d71d60af6752d94256f2908889fb72e8e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.4.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on hexz-org/hexz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hexz-0.4.3-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: hexz-0.4.3-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.5 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hexz-0.4.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 935bbf23c2e669e77a4ce20bccd0fe159abb205fa4def184f6874ebb0cab9ee7
MD5 c15758b4c01cabc192f113b5dd7fee9e
BLAKE2b-256 a6440fccf31e33c44d87b1c6df298d2b616c0ed3982cc00706eec249b8e8b47a

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.4.3-cp38-abi3-win_amd64.whl:

Publisher: release.yml on hexz-org/hexz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hexz-0.4.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hexz-0.4.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 823f2e6ed2f4177269d3f39c3a7ad3e9bd91dce8cb08b25989309f41b80fc391
MD5 bab7664b762f56b21bdd2369f14ac3be
BLAKE2b-256 d3aa6ff9daae0a7a8911029f487bb77f1d9b85a3fe9d592c7c49722335684e02

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.4.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on hexz-org/hexz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hexz-0.4.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hexz-0.4.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 29895c83b759db7c944e7465c59538f0b0e00dbe876bb4467e3877872f60b04f
MD5 ca14ce77cd66680e878b9755d3052664
BLAKE2b-256 4d18b2e60496de1beb0ecbb5ce653d499f879452e63391872cc613066af4727e

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.4.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on hexz-org/hexz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hexz-0.4.3-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: hexz-0.4.3-cp38-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.8+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hexz-0.4.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3cbfb98fe72019120ebc18b8fca12ed2065bf7dd3abcc3150f766a6862686506
MD5 dceb42b8e941d8fa10d7ac7b20625e28
BLAKE2b-256 1cf15fc4976c5c900ee4cfdbbdd5bb7c11d1da7920bf4bae825a9cf9c8c628d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.4.3-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on hexz-org/hexz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hexz-0.4.3-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for hexz-0.4.3-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3fb033f01330f48b7d3764212d04fe98ecdaa179e1e28b88ecd77948303f0b18
MD5 c8e380266e3d138a415f3582511f0a00
BLAKE2b-256 6682b3b8702ea5a9bf8ba163379bb9d1cd3992591c2e9fac3cee67c3b18e2f31

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.4.3-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on hexz-org/hexz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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