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.1.2.tar.gz (384.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.1.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

hexz-0.1.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.8+Windows x86-64

hexz-0.1.2-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.1.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.3 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.8+macOS 11.0+ ARM64

hexz-0.1.2-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.1.2.tar.gz.

File metadata

  • Download URL: hexz-0.1.2.tar.gz
  • Upload date:
  • Size: 384.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.1.2.tar.gz
Algorithm Hash digest
SHA256 c7b1b7f0f9f70cc230fadbc8af919d47b1c1d05c11e95a7546b4daf53c1ce964
MD5 076a587079356bd1a791092e6328f757
BLAKE2b-256 f7d39979e39b47a13c5d3928070fac395e918e928a3e874970b4a74e5eac7cdc

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.1.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b3115dad167f29970bdb282454364b476ec0cbe258483559c365046d20a8b9c6
MD5 be6065905541d77a0b05bf45d6928442
BLAKE2b-256 99a25b94e7bb16f6f1f3b1f3fe4787520b2c239ee44593a28c21dde3f43c766c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.1.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 145522766d162ab74fc5f5b0677aa5aaf851b654f8fb76493c4650b3cc1b44be
MD5 ecd124f14e431689e4f435a3a06ccb6d
BLAKE2b-256 d9f3cac749bcccc216e76f83ed2b899f34164943f15e513f4cd57db912a7dbce

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hexz-0.1.2-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.1.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ed257f7b29758067c52b389ae86dae7bfbde31fb5f11bdccb4936582a4093325
MD5 ab390d488a8388f0153d27e280d40e9e
BLAKE2b-256 96f4032f70dfb8934ab1dd06e47afeb493e2946b9664a610692bb430f5f63e31

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.1.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f89816bd838a823863c3e416616ea9ecc4187c2e0ef6dc9eb3ee7a2b760ff93f
MD5 c1f13124c2317a1ef2f0310a20907157
BLAKE2b-256 9989042e42b408af28ffe2c3d3d3da71edfc033aaee3a4fdda28a2876806fb6d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.1.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5157d3a318c321714f0e215b479e43e4e29ba3f709f22b757c214e2a19bfca4c
MD5 8a540e8733edd619ef8e7e572ba7ff73
BLAKE2b-256 ea0ff038064d7a170f42e057d8434a57c0e9d778d22008842088ef0a2f148930

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hexz-0.1.2-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.1.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2dc4503aa3c8166207e57ad7fe0d83ee998d12763d5eb9a4aba9cf316bd4188d
MD5 a4837116b8b658515f65aa99362a2367
BLAKE2b-256 bd959b4a3ddbec8f51eb41841222fae79a6e7b5339289f47f65aa51aa7624f18

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.1.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3609ef44bb7b05e2aa2eee63f4ea8ad847ee24260e343c96c94219dc274bbae0
MD5 b04d8d828b11eed0ae57dec19e93b1be
BLAKE2b-256 3d8e63ac0a58d10c0aed82dab396a902b5f49bfcf3faea091932ea790bff6a69

See more details on using hashes here.

Provenance

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