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. HDF5 compression filters can be also be installed either system-wide on Linux or through Anaconda (blosc-hdf5-plugin, hdf5-lz4)

The HDF5 plugin sources were obtained from:

Installation

To install, just run:

pip install hdf5plugin

To install locally, run:

pip install hdf5plugin --user

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), compression=hdf5plugin.LZ4_ID)
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’

    • ‘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.0.0.tar.gz (4.6 MB view details)

Uploaded Source

Built Distributions

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

hdf5plugin-2.0.0-py3-none-win_amd64.whl (295.7 kB view details)

Uploaded Python 3Windows x86-64

hdf5plugin-2.0.0-py2.py3-none-manylinux2010_x86_64.whl (3.8 MB view details)

Uploaded Python 2Python 3manylinux: glibc 2.12+ x86-64

hdf5plugin-2.0.0-py2.py3-none-manylinux1_x86_64.whl (3.8 MB view details)

Uploaded Python 2Python 3

hdf5plugin-2.0.0-py2.py3-none-macosx_10_9_x86_64.whl (668.2 kB view details)

Uploaded Python 2Python 3macOS 10.9+ x86-64

hdf5plugin-2.0.0-py2-none-win_amd64.whl (435.0 kB view details)

Uploaded Python 2Windows x86-64

File details

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

File metadata

  • Download URL: hdf5plugin-2.0.0.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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.0.0.tar.gz
Algorithm Hash digest
SHA256 dcdacb376ebd513b09f864934e4319988b7fbba78474c7dc013d8e2775de06a4
MD5 9447fad6f8b887ef63f9aae712201524
BLAKE2b-256 5a803b7cd5cd844231fffdf566099301ae82ab31aa7cb5f086758c3a2f72f658

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdf5plugin-2.0.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 295.7 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.0.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 530629b004eba0c93b2d9bbfce0d6ea286c88be713303ad7a2f8c8a7a41b9d6b
MD5 29d3d4f9adfca2f233b6dc128b8e6c26
BLAKE2b-256 58d9403310cab17608a9195abb539a9e9db236309be4ddc107ef7547e72e011f

See more details on using hashes here.

File details

Details for the file hdf5plugin-2.0.0-py2.py3-none-manylinux2010_x86_64.whl.

File metadata

  • Download URL: hdf5plugin-2.0.0-py2.py3-none-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: Python 2, Python 3, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.0.0-py2.py3-none-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 022cc82a4747e411ef911c9bfdcf384ebf0dd5ead459c9d62676fd3e500c616a
MD5 dee56de99cc04ebe4564cb918960a49b
BLAKE2b-256 eb07ed33ee8ed40e8670176caa9087a4ed9aae016be2b16ae424e62070a42196

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdf5plugin-2.0.0-py2.py3-none-manylinux1_x86_64.whl
  • Upload date:
  • Size: 3.8 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.0.0-py2.py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 3b2cb962b122ef08543fdcd69237d3d175b60302d1063bdca8611cbf13e71bf7
MD5 14206de0fdd3c1ea5f6b19f869d6f6b8
BLAKE2b-256 8704a19e98a1dc749a3725107888604d6f5fb03ae46a3fca300749c0a85b3b3e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdf5plugin-2.0.0-py2.py3-none-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 668.2 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.0.0-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c98db2dfd1a6f9138ca4ebaa15675c54d40bb66d6d62c224b3a3bab8ce2500fd
MD5 cc9a4980925884018a74ad30305cd583
BLAKE2b-256 389899117c8065dc4144c3fba6f84d0af0fabbb293335a6613e7b6d31d2440c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hdf5plugin-2.0.0-py2-none-win_amd64.whl
  • Upload date:
  • Size: 435.0 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

File hashes

Hashes for hdf5plugin-2.0.0-py2-none-win_amd64.whl
Algorithm Hash digest
SHA256 12da257545e74f8687d699dbf64e5c671a978b62abae132ac454c8e2340a15ce
MD5 339849f4c15357d9c155f5bdce2845f9
BLAKE2b-256 c5ef4de6622f60060415074ef393f244adaf8f1abae93e64e2890fe994cf0295

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