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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blosc2_openzl-0.0.1-py3-none-win_amd64.whl.
File metadata
- Download URL: blosc2_openzl-0.0.1-py3-none-win_amd64.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
146818f6516c90acca5d912755fa19bebd623be67c1391342db50dfd79ff8205
|
|
| MD5 |
6900fba8c8441f417b363998148b3e0e
|
|
| BLAKE2b-256 |
73a98e5242fcbd951dce45a026c78d721cedba95e5772050dca247b804d143aa
|
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
- Download URL: blosc2_openzl-0.0.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 6.1 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65abb4d24a1345470a2924c78e8f14032a401d6f9c75455611454eed3ff4d36f
|
|
| MD5 |
28d9e8fbfe5e9a0e92b242ff78030ee3
|
|
| BLAKE2b-256 |
167760292a93eb032db957652f72b3c568042603b382d4a2559b65eab62b467d
|
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
- Download URL: blosc2_openzl-0.0.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 5.7 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b813824c2666b0cf1c67b2f23dad8ba7b0187d0e2b4d77607386a8b55240377c
|
|
| MD5 |
28e2825f9a78e4cbcc31a511e6b56061
|
|
| BLAKE2b-256 |
878c3822195ecfdf9436c51c748c1b4f76a6ad51a270de82cb92154e0a90409e
|
File details
Details for the file blosc2_openzl-0.0.1-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: blosc2_openzl-0.0.1-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.2 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d94eabeb1239529613de6216f170e780becccd4485b8be96390b17aab03e9af
|
|
| MD5 |
daae9a3de7e58b134726e47ad37eacec
|
|
| BLAKE2b-256 |
f95eab8d3f1d647ddedd9d936b274887b04cb0368b705c67a2285cae4fd2a7a9
|