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
Metadata
Release files for blosc2-openzl 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| blosc2_openzl-0.0.1-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| blosc2_openzl-0.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 | Details |
| blosc2_openzl-0.0.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 | Details |
| blosc2_openzl-0.0.1-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 16.9 MB
Release files / blosc2_openzl-0.0.1-py3-none-win_amd64.whl
| Download URL | blosc2_openzl-0.0.1-py3-none-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
146818f6516c90acca5d912755fa19bebd623be67c1391342db50dfd79ff8205
|
|
BLAKE2b-256 checksum How to use checksums |
73a98e5242fcbd951dce45a026c78d721cedba95e5772050dca247b804d143aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blosc2_openzl-0.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
| Download URL | blosc2_openzl-0.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.1 MB |
| Tags | Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
65abb4d24a1345470a2924c78e8f14032a401d6f9c75455611454eed3ff4d36f
|
|
BLAKE2b-256 checksum How to use checksums |
167760292a93eb032db957652f72b3c568042603b382d4a2559b65eab62b467d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blosc2_openzl-0.0.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl
| Download URL | blosc2_openzl-0.0.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.7 MB |
| Tags | Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
b813824c2666b0cf1c67b2f23dad8ba7b0187d0e2b4d77607386a8b55240377c
|
|
BLAKE2b-256 checksum How to use checksums |
878c3822195ecfdf9436c51c748c1b4f76a6ad51a270de82cb92154e0a90409e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / blosc2_openzl-0.0.1-py3-none-macosx_11_0_arm64.whl
| Download URL | blosc2_openzl-0.0.1-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2d94eabeb1239529613de6216f170e780becccd4485b8be96390b17aab03e9af
|
|
BLAKE2b-256 checksum How to use checksums |
f95eab8d3f1d647ddedd9d936b274887b04cb0368b705c67a2285cae4fd2a7a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|