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.5.5.tar.gz (395.2 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.5.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.4 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

hexz-0.5.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.4 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

hexz-0.5.5-cp38-abi3-win_amd64.whl (3.6 MB view details)

Uploaded CPython 3.8+Windows x86-64

hexz-0.5.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.5 MB view details)

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

hexz-0.5.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.4 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

hexz-0.5.5-cp38-abi3-macosx_11_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

hexz-0.5.5-cp38-abi3-macosx_10_12_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for hexz-0.5.5.tar.gz
Algorithm Hash digest
SHA256 b9e759cfdfae2b4810865289be35e73b50728e372c11ebe777138dab8ed55995
MD5 e97250d61ec3349c189e308f4d5375b2
BLAKE2b-256 f9ae476ef678c1a46746179fad28d275768b9eefe238c3b565f3fb37df5c9912

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.5.5.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.5.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hexz-0.5.5-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b0475a412b63c10a5b54ec5a0ea12f85c8d8bd67acea5341a5e1969a2c1a931f
MD5 30aa81daba4ecd7b14c4768a2a9405a3
BLAKE2b-256 3e8e0d51540beb97940358625a09c2202b2290ef383c6f9be6c8b2b2b9be81f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.5.5-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.5.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hexz-0.5.5-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ceeb6a2b3cfce74215b1ff1d61f5010dd2e7c1ab4944b1d59ce357b28d5fe2c5
MD5 1054702ddb6298457737e873a2bd7c53
BLAKE2b-256 a90a65d36e777f2175d67f7995c5e86385126e52e0ae795d8eb3f2fd2da96cda

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.5.5-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.5.5-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: hexz-0.5.5-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.6 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.5.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 16ca93f7c7b5896b96a61a77da1e1eb95bc8928dc27197e4f94dd7fe4c6d8c1b
MD5 6e0dfd5f43440513071da50ab113a058
BLAKE2b-256 1f0d50518c1c5a8c4d1a9afe1c177f899b896224e9f9404eb62833c7a01b0c57

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.5.5-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.5.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hexz-0.5.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 450fe083b59476d7db418e8ce957d05f9d57f5b07820b9713f9d83e22f32f99d
MD5 393fd170f445f559dc258d7f5891b423
BLAKE2b-256 d53454d00bb81a197594213cff159aa9a8dcbc1bac52490f7027079dcfc6b7b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.5.5-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.5.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hexz-0.5.5-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7d0cf0f0bad159ff0a82817c848be1ee7dbff1aa8794cfa997516fa1e3a5b295
MD5 46aaa495e7bb5dc15fac153188cd6e65
BLAKE2b-256 ad633625354ea203707014de3b117af1fdb9e48af46dd2ee4b4082e4fe9d6310

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.5.5-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.5.5-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: hexz-0.5.5-cp38-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.9 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.5.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a817840999137b867745c9c45eefa9047beef895bc4426210be1c4c8fc521bd6
MD5 faf0a1544bce67807471d6f5740c5372
BLAKE2b-256 0a036ac0eba5d6767d0a680661daa6551e020e0dc925ba274e1f0cfa15063568

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.5.5-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.5.5-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for hexz-0.5.5-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b7f549c6899c0ebee296712f5518600e16107515ca1547809389164a02e3e34d
MD5 d40b32661b054c6bdf3ded96cd0eeb58
BLAKE2b-256 5fd035118597887a0ebd9b674bf7a8415c3fb0ce04707ac158120cdb15f62687

See more details on using hashes here.

Provenance

The following attestation bundles were made for hexz-0.5.5-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