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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.8+Windows x86-64

hexz-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.4 MB view details)

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

hexz-0.5.0-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.0-cp38-abi3-macosx_11_0_arm64.whl (3.9 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

hexz-0.5.0-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.0.tar.gz.

File metadata

  • Download URL: hexz-0.5.0.tar.gz
  • Upload date:
  • Size: 399.0 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.0.tar.gz
Algorithm Hash digest
SHA256 616b3841b8e20e6ab5c76b4d6bd7f1689c17eda391207d0ef5d405781847d754
MD5 aeb5b8f93fe3df334f427a3f5a20c038
BLAKE2b-256 6855a73b3f89bb41db75d7ba7d5bf0888625810906f7706451c94d4ec38367cb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.5.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 63c5cb4b3bd0c50ad85717a96b80d3e590521ca81aef5bbc5451ab44c6e2829e
MD5 4074e84888eef5d395a4bead10f125a9
BLAKE2b-256 11bfb36c5ccac5e1e1e9437baa217da2b27782abcc1f838636587f86a2becc21

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.5.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4214e1b812a25550dc33b346efff635703f2eeefb1c5feed493e083f5fa2f4af
MD5 879852bc154a2028ecfba40c04c762d0
BLAKE2b-256 c8e9246a722fc16a826563818307a61866e3b06147679206f9d2f836a1180b7d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hexz-0.5.0-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.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9711eef58a1710601b89329e88a1479fbd3088a8c55de8f7d35fe55b2008b6bc
MD5 b1d77a40afcdf42179b44dc725bc8e9d
BLAKE2b-256 5c57131ffba1035d80e19677f7c0dc767d0a0a12f527a984e031741518ff8314

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8b8f0336ecf0ad3fb21c5af893d22601509dd623325048eb251b23b9ad2dd8d4
MD5 6b19e5f8ee5d2998c910083a25699e4e
BLAKE2b-256 4d5577b2c2f3fef901763e75d3664951f19cfc983c3d64cc4240bffbb1c2f69e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 663138d8f98b36f8ab354bdf66f12eaf876d308abc185e87d6882f5ca1062f46
MD5 ced2a08b9ef192611103effb6a7b262e
BLAKE2b-256 42e9456d2a6a31f703567d926b51c789cc99085f699cf6f31f9398a1946ffd55

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hexz-0.5.0-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.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 768d9db68f16799dd66428c3a107b2e9fe367253ed0e9ad0fd22673335f466d2
MD5 21f42ad2943f1aea8301d784bcbd00b2
BLAKE2b-256 774c11e6ece3a976be85f7afa6c51aaec7d50319a708397fe9a2b80cbc811aaa

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 515756a28729e3237628f2e1e13deaaaf8fedf79b543e7f39678080733888116
MD5 b99a38cb01d59225a1056af7ed93254c
BLAKE2b-256 1898724d1b2c5890c0ad77af83463a05ae3e4b785f3a70009ea58e2eb1dfc0a7

See more details on using hashes here.

Provenance

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