Skip to main content

OpenZL plugin for Blosc2.

Project description

Blosc2 OpenZL

A dynamic codec plugin for Blosc2 that allows one to compress and decompress data using the OpenZL compression library. For details, check out the project README. With this plugin, you can use it as yet another codec in applications using Blosc2. See an example of use at: https://github.com/Blosc/blosc2-openzl/blob/main/tests/test_meta.py

Installation

For using blosc2_openzl you will first have to install its wheel:

pip install blosc2-openzl -U

Usage

import blosc2
import numpy as np
import blosc2_openzl

# Define the compression and decompression parameters for Blosc2.
cparams = {
    'codec': blosc2.Codec.OPENZL,
    'filters': [],
    'codec_meta': 7,
}

# Create array to be compressed
np_array = np.arange(1000).reshape((10,100))

# Transform the numpy array to a blosc2 array. This is where compression happens, and
# the OpenZL codec is called.
bl_array = blosc2.asarray(
    np_array,
    cparams=cparams
)

# Print information about the array, see the compression ratio (cratio)
print(bl_array.info)

Parameters for compression

One may set the OpenZL graph using codec_meta, an 8-bit integer corresponding to meta information relating to codecs, filters and other nodes for the compression graph. Starting from the Least-Significant-Bit (LSB), setting the bits tells OpenZL how to build the graph: CODEC | SHUFFLE | DELTA | SPLIT | CRC | x | x | x |

  • CODEC - If set, use LZ4. Else ZSTD.
  • SHUFFLE - If set, use shuffle (outputs a stream for every byte of input data typesize)
  • DELTA - If set, apply a bytedelta (to all streams if necessary)
  • SPLIT - If set, do not recombine the bytestreams
  • CRC - If set, store a checksum during compression and check it during decompression

The remaining bits may be used in the future.

Thanks

Thanks to Luke Shaw, Marta Iborra, J. David Ibáñez and Francesc Alted from the Blosc Development Team, for making this plugin possible. Thanks also to the OpenZL team for authoring of the OpenZL library.

That's all folks!

The Blosc Development Team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

blosc2_openzl-0.0.1-py3-none-win_amd64.whl (1.8 MB view details)

Uploaded Python 3Windows x86-64

blosc2_openzl-0.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (6.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

blosc2_openzl-0.0.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl (5.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

blosc2_openzl-0.0.1-py3-none-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file blosc2_openzl-0.0.1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for blosc2_openzl-0.0.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 146818f6516c90acca5d912755fa19bebd623be67c1391342db50dfd79ff8205
MD5 6900fba8c8441f417b363998148b3e0e
BLAKE2b-256 73a98e5242fcbd951dce45a026c78d721cedba95e5772050dca247b804d143aa

See more details on using hashes here.

File details

Details for the file blosc2_openzl-0.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for blosc2_openzl-0.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 65abb4d24a1345470a2924c78e8f14032a401d6f9c75455611454eed3ff4d36f
MD5 28d9e8fbfe5e9a0e92b242ff78030ee3
BLAKE2b-256 167760292a93eb032db957652f72b3c568042603b382d4a2559b65eab62b467d

See more details on using hashes here.

File details

Details for the file blosc2_openzl-0.0.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for blosc2_openzl-0.0.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b813824c2666b0cf1c67b2f23dad8ba7b0187d0e2b4d77607386a8b55240377c
MD5 28e2825f9a78e4cbcc31a511e6b56061
BLAKE2b-256 878c3822195ecfdf9436c51c748c1b4f76a6ad51a270de82cb92154e0a90409e

See more details on using hashes here.

File details

Details for the file blosc2_openzl-0.0.1-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for blosc2_openzl-0.0.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d94eabeb1239529613de6216f170e780becccd4485b8be96390b17aab03e9af
MD5 daae9a3de7e58b134726e47ad37eacec
BLAKE2b-256 f95eab8d3f1d647ddedd9d936b274887b04cb0368b705c67a2285cae4fd2a7a9

See more details on using hashes here.

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