Skip to main content

HDF5 Plugins for windows,MacOS and linux

Project description

This module provides HDF5 compression filters (namely: blosc, bitshuffle and lz4) and registers them to the HDF5 library used by h5py.

  • Supported operating systems: Linux, Windows, macOS.

  • Supported versions of Python: 2.7 and >= 3.4

hdf5plugin provides a generic way to enable the use of the provided HDF5 compression filters with h5py that can be installed via pip or conda.

Alternatives to install HDF5 compression filters are: system-wide installation on Linux or other conda packages: blosc-hdf5-plugin, hdf5-lz4.

The HDF5 plugin sources were obtained from:

Installation

To install, run:

pip install hdf5plugin [--user]

or, with conda (https://anaconda.org/conda-forge/hdf5plugin):

conda install -c conda-forge hdf5plugin

To install from source and recompile the HDF5 plugins, run:

pip install hdf5plugin --no-binary hdf5plugin [--user]

Installing from source can achieve better performances by enabling AVX2 and OpenMP if available.

Documentation

To use it, just use import hdf5plugin and supported compression filters are available from h5py.

Sample code:

import numpy
import h5py
import hdf5plugin

# Compression
f = h5py.File('test.h5', 'w')
f.create_dataset('data', data=numpy.arange(100), **hdf5plugin.LZ4())
f.close()

# Decompression
f = h5py.File('test.h5', 'r')
data = f['data'][()]
f.close()

hdf5plugin provides:

Bitshuffle(nelems=0, lz4=True)

This class takes the following arguments and returns the compression options to feed into h5py.Group.create_dataset for using the bitshuffle filter:

  • nelems the number of elements per block, needs to be divisible by eight (default is 0, about 8kB per block)

  • lz4 if True the elements get compressed using lz4 (default is True)

It can be passed as keyword arguments.

Sample code:

f = h5py.File('test.h5', 'w')
f.create_dataset('bitshuffle_with_lz4', data=numpy.arange(100),
      **hdf5plugin.Bitshuffle(nelems=0, lz4=True))
f.close()

Blosc(cname=’lz4’, clevel=5, shuffle=SHUFFLE)

This class takes the following arguments and returns the compression options to feed into h5py.Group.create_dataset for using the blosc filter:

  • cname the compression algorithm, one of:

    • ‘blosclz’

    • ‘lz4’ (default)

    • ‘lz4hc’

    • ‘snappy’ (optional, requires C++11)

    • ‘zlib’

    • ‘zstd’

  • clevel the compression level, from 0 to 9 (default is 5)

  • shuffle the shuffling mode, in:

    • Blosc.NOSHUFFLE (0): No shuffle

    • Blosc.SHUFFLE (1): byte-wise shuffle (default)

    • Blosc.BITSHUFFLE (2): bit-wise shuffle

It can be passed as keyword arguments.

Sample code:

f = h5py.File('test.h5', 'w')
f.create_dataset('blosc_byte_shuffle_blosclz', data=numpy.arange(100),
    **hdf5plugin.Blosc(cname='blosclz', clevel=9, shuffle=hdf5plugin.Blosc.SHUFFLE))
f.close()

LZ4(nbytes=0)

This class takes the number of bytes per block as argument and returns the compression options to feed into h5py.Group.create_dataset for using the lz4 filter:

  • nbytes number of bytes per block needs to be in the range of 0 < nbytes < 2113929216 (1,9GB). The default value is 0 (for 1GB).

It can be passed as keyword arguments.

Sample code:

f = h5py.File('test.h5', 'w')
f.create_dataset('lz4', data=numpy.arange(100),
    **hdf5plugin.LZ4(nbytes=0))
f.close()

Dependencies

Testing

To run self-contained tests, from Python:

import hdf5plugin.test
hdf5plugin.test.run_tests()

Or, from the command line:

python -m hdf5plugin.test

To also run tests relying on actual HDF5 files, run from the source directory:

python test/test.py

This tests the installed version of hdf5plugin.

License

The source code of hdf5plugin itself is licensed under the MIT license. Use it at your own risk. See LICENSE

The source code of the embedded HDF5 filter plugin libraries is licensed under different open-source licenses. Please read the different licenses:

The HDF5 v1.10.5 headers (and Windows .lib file) used to build the filters are stored for convenience in the repository. The license is available here: src/hdf5/COPYING.

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

hdf5plugin-2.1.2.tar.gz (4.6 MB view details)

Uploaded Source

Built Distributions

hdf5plugin-2.1.2-py3-none-win_amd64.whl (310.2 kB view details)

Uploaded Python 3 Windows x86-64

hdf5plugin-2.1.2-py2.py3-none-manylinux2014_x86_64.whl (3.4 MB view details)

Uploaded Python 2 Python 3

hdf5plugin-2.1.2-py2.py3-none-manylinux2014_ppc64le.whl (3.2 MB view details)

Uploaded Python 2 Python 3

hdf5plugin-2.1.2-py2.py3-none-manylinux1_x86_64.whl (2.4 MB view details)

Uploaded Python 2 Python 3

hdf5plugin-2.1.2-py2.py3-none-macosx_10_9_x86_64.whl (684.0 kB view details)

Uploaded Python 2 Python 3 macOS 10.9+ x86-64

hdf5plugin-2.1.2-py2-none-win_amd64.whl (435.8 kB view details)

Uploaded Python 2 Windows x86-64

File details

Details for the file hdf5plugin-2.1.2.tar.gz.

File metadata

  • Download URL: hdf5plugin-2.1.2.tar.gz
  • Upload date:
  • Size: 4.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.1.2.tar.gz
Algorithm Hash digest
SHA256 11da0aa6114ce20d98574f4c620dc1424b43e51ea5a219e2d203144f33c05193
MD5 70dc5dc2dac448466e1fd2bfbbd57ec4
BLAKE2b-256 ddc267e7da0635330827f7cd004f35b3e6893a9445968a4dc7c808a37a8aee56

See more details on using hashes here.

File details

Details for the file hdf5plugin-2.1.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: hdf5plugin-2.1.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 310.2 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.1.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 5677e71b712cdec3d8d5d03aa76251879701e94b510cf0f683660f467d826a04
MD5 ee9265b9924c56e6a80ba0751470690e
BLAKE2b-256 768d8943c13e8ad1350fc3c155778664e31b1574b67d4bf820e890319d452748

See more details on using hashes here.

File details

Details for the file hdf5plugin-2.1.2-py2.py3-none-manylinux2014_x86_64.whl.

File metadata

  • Download URL: hdf5plugin-2.1.2-py2.py3-none-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.1.2-py2.py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd51333530f239b43a49dc912a698e5e54d1516867241fc3af4a592795c02663
MD5 215d6aaa0dd9510ba6cb45fc95360c94
BLAKE2b-256 01cf6fb97719b05fb41f3a03cdf90aecb0808250b55198dad50ff9f088bbd9aa

See more details on using hashes here.

File details

Details for the file hdf5plugin-2.1.2-py2.py3-none-manylinux2014_ppc64le.whl.

File metadata

  • Download URL: hdf5plugin-2.1.2-py2.py3-none-manylinux2014_ppc64le.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.1.2-py2.py3-none-manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 41e1314041bc9c43ddf0d1d51174f902df329704442ff25abb94976ec388b1d1
MD5 7b235be3ab8e726386bd5d054403118e
BLAKE2b-256 2561e43dbd674eb91d03b87a0693e8bd3fea332e38b970436de06db1aa3c9e6a

See more details on using hashes here.

File details

Details for the file hdf5plugin-2.1.2-py2.py3-none-manylinux1_x86_64.whl.

File metadata

  • Download URL: hdf5plugin-2.1.2-py2.py3-none-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.1.2-py2.py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0ae84eb304613a7d7d595842535ff01a3341250116fd3a1714526f7dd9dca624
MD5 8a9944dc6b7c3ad73a7da0de2c8652ab
BLAKE2b-256 a7123b9f57a40dc81edd7eeb01850466ba511b1fdfd3e34ef9d666f79c42f50c

See more details on using hashes here.

File details

Details for the file hdf5plugin-2.1.2-py2.py3-none-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: hdf5plugin-2.1.2-py2.py3-none-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 684.0 kB
  • Tags: Python 2, Python 3, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.1.2-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 25ce0ab004af17889f85e363956586ecc0c9d7ae98b7dafcc994f10ba0b7ca13
MD5 968acd03bf8c473e728ad3e3c4ac6db6
BLAKE2b-256 742fde9543d58c0eac002f2ca8baafd6f4f1cbb44ce023c0238c2010eb112610

See more details on using hashes here.

File details

Details for the file hdf5plugin-2.1.2-py2-none-win_amd64.whl.

File metadata

  • Download URL: hdf5plugin-2.1.2-py2-none-win_amd64.whl
  • Upload date:
  • Size: 435.8 kB
  • Tags: Python 2, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.1.2-py2-none-win_amd64.whl
Algorithm Hash digest
SHA256 3f6ce87689fa350202e5cb1b38bcd6c850a114a14c6544aa0733bbef578b65a1
MD5 c5372543495217e06fa1773d8f20aa5c
BLAKE2b-256 7897894815ad2759081e2426102aa9a54a7826fdd5b2a9aba7db34cb2bf3b8ef

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page