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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded PyPymanylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.8+Windows x86-64

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

Uploaded CPython 3.8+macOS 11.0+ ARM64

hexz-0.3.0-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.3.0.tar.gz.

File metadata

  • Download URL: hexz-0.3.0.tar.gz
  • Upload date:
  • Size: 396.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.3.0.tar.gz
Algorithm Hash digest
SHA256 e2eaa22654c225aa62fb3320ba6147117a025f9c87997d69f5623fe1f958cd22
MD5 f6911babf7ac5b437d4060cc1a45d6f9
BLAKE2b-256 0a6abdcccfe8bac02692d17d1b6cf5a5d7a04669ee7d625e9788c57652061ecd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.3.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 14b6f0012094cf39fcf542dbe1187d80c929c847c4885f09bee27437957e19cb
MD5 9db84a036697a64f0ca68784abc13503
BLAKE2b-256 fd2f92c106a9561d74b5fcd2d06942d866f0d5fb53cce0f599b1917a523afb35

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.3.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 92c806f4b70ac898dd8c075b1e7f4443e501cf986d68e88dd9c8be3869db4dc8
MD5 e6a42ab82861c01dfae0b8ca30eb1254
BLAKE2b-256 498f8ded1bd83c28998d7f4afb1c4bb271757c90c8299e5a8536ea417b7bd7b3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hexz-0.3.0-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.3.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3325ad2fcf3277213223eab07f34c02fe962628269063d134b07bb8c49025c46
MD5 91b1199c6081397f773ed150cf3639e4
BLAKE2b-256 0cce5da90d12613eef947a797df6da1137d3f569eb53000e5414ad863ab2f6b3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 915fccb878be74c41eda7339edf3ea6e355a9693d90e80387f076a6f2aaa8971
MD5 70cd3ca195450dd9fb768629246e1ce0
BLAKE2b-256 a3d084f9f19bb716a57071c5944d4037c02b0b4a9f3ab4cfa8b112ef2e613821

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.3.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4d3f6eae126fed290142ce5b910872a0150e8f43ce8dacfe536c6384acca51a4
MD5 25fa2f439640089b55a5704b32407762
BLAKE2b-256 b747bfd4991967657d32346013696e47a9d5d94c25939d8148cebe363a1acfb6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: hexz-0.3.0-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.3.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3fc77d8f65756073230378aca6cb9678b971d83f218b058ad3af0f9f41126ee7
MD5 cd98b840ed21de9b954928039814f3b8
BLAKE2b-256 53918dd992ac95b44008ce00162024ad2b515dbcb5a25fd0a73b7468224717cf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for hexz-0.3.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 096f6b00de54b14285ca84995b24662c3f918c974bc34310cc2e5b33c37011eb
MD5 f967289dbbdff409dd46ca305bc0d1ae
BLAKE2b-256 9df5d729b2f95c79534824919ab1d20d5a7a1dad1f6250417969c69b315aa62a

See more details on using hashes here.

Provenance

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