hdf5plugin is a Python library that provides additional HDF5 compression filters for use with h5py, enabling reading and writing of compressed datasets with various algorithms like Blosc, Bitshuffle, LZ4, Zstd, and more. It is actively maintained with frequent releases, currently at version 6.0.0, and often updates its embedded compression libraries and introduces new filters.
pip install hdf5pluginVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to write and read a dataset compressed using one of the filters provided by hdf5plugin (LZ4 in this case). The `import hdf5plugin` statement is crucial as it registers the filters with h5py.
Ensure your Python environment is 3.9 or newer. Downgrade hdf5plugin if an older Python version is strictly required.
Upgrade h5py to version 3.0.0 or higher. You may also need to upgrade Python if h5py's requirements for newer versions conflict with your setup.
Replace usage of these constants. For `hdf5plugin.config`, use `hdf5plugin.get_config()` instead. Other removed constants do not have direct replacements and should be removed if no longer necessary.
Migrate away from using the SZ filter to other supported filters like SZ3, Zfp, or Blosc for future compatibility and better performance/features.
Ensure that the hdf5plugin version used for reading ZFP-compressed data is at least as new as, or newer than, the version used for writing.
If encountering errors with specific Blosc2 codecs, consult the Blosc2 documentation for required external plugins and ensure they are installed and discoverable via the HDF5_PLUGIN_PATH environment variable.
Design chunking to align with expected read/write access patterns. Refer to HDF5 and h5py documentation on chunking best practices for optimal performance with compressed datasets.
Ensure `hdf5plugin` is installed (`pip install hdf5plugin` or `conda install -c conda-forge hdf5plugin`) and explicitly import it in your Python script before any `h5py` operations: `import hdf5plugin`. This import registers the necessary filters with the HDF5 library.
First, ensure `hdf5plugin` is installed and imported: `import hdf5plugin`. If the problem persists, consider reinstalling `hdf5plugin` from source or via `conda-forge` to ensure all underlying C libraries are correctly linked and compatible with your `h5py` and HDF5 installation.
Install the `hdf5plugin` package using your preferred package manager: `pip install hdf5plugin` (for pip) or `conda install -c conda-forge hdf5plugin` (for Anaconda/Miniconda).