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.4.tar.gz (401.3 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.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (4.2 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.8+Windows x86-64

hexz-0.4.4-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.4-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.4-cp38-abi3-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

hexz-0.4.4-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.4.tar.gz.

File metadata

  • Download URL: hexz-0.4.4.tar.gz
  • Upload date:
  • Size: 401.3 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.4.tar.gz
Algorithm Hash digest
SHA256 0dc5d3cc1b2ee9748036f560b13e53375a5bccff4eee9728c8186e6720b9b2c5
MD5 bfa3a7b55d89a7feee5d6f0c16a4ce8f
BLAKE2b-256 57bc14e46bc33fdefdd573b823eacedcf12a70baec8ac602cd726241cc354b63

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.4.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0cce0c142d8e03cdbe96cc6fef1a523f5631cb1d4f3e37d808eabb8dbf931e7a
MD5 4fc90dde1dcd89dad2c2df75179f297a
BLAKE2b-256 e616a58cd2de3e5356a40bb3bcdaed35f1f691c5100bb1b15f1d1aad5f738ca8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.4.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d08b53ae25940851d4ee7e717d9bd0e9138e7e84b0dc5f2b50119a80852624fd
MD5 ef740a8e2ae7d9e82946b449817f53e4
BLAKE2b-256 5b9b9b92f0a782fec5742ed0a6ea4d188d33eff7ca37e77584e75b19be18b65d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hexz-0.4.4-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.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f0503ddf560b1a36b322682a254a8259fe9dce50423105631c357ed719e26fa5
MD5 b8fa89e9fb2ef8d67d3536033d66c027
BLAKE2b-256 55186bd1662660d2704b611f43e29fb4a6cadf587cd0355ebc445f7ef228e27e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.4.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9d034477bbdcf7c61f4f3426ac5e9fcb4092cd786fd38af1ea8ae1ac29ad7bdf
MD5 cb555ae6ebd0823b354c69e1948b7335
BLAKE2b-256 00373d04a87854cf4c745639ad6741db52e5ed5134a5b82c2d3ab9ad62f743c0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.4.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ed2d7cfa86b9b1a1543678c1c32b4d6cfff11b0ed5e34a3019eebe98072d9cd1
MD5 abcd2fb08b2bbc58c1722b51fa9d281a
BLAKE2b-256 a6739ec4a6ee99c958d92dfd8d47da5ab34f315878a26a5d5e704a7a8adfff90

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hexz-0.4.4-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.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad96806b3eb9c8f45e59b99bc5ec25879f529847bfa69a0d38134380fd2e1b0a
MD5 33ed7b6aa65fb8e3be15846c86d4a950
BLAKE2b-256 11ed60b7c2d26f6cb358360daf2155c058a4ec8c04b6abdc646749ad863e5935

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.4.4-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 560bee7750a934a02153142511f4c861fedfe86267dd389d544f0e59faf97af1
MD5 6a646eb85c7a806d4b6b7ffca1863f97
BLAKE2b-256 fae4568ff8ecbf8d15f51d5f218d151994205e5c541e6080e3d8a7bbf5cb2ec7

See more details on using hashes here.

Provenance

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