Skip to main content

Core utilities to serve HDF5 file contents

Project description

h5grove, core utilities to serve HDF5 file contents

h5grove is a Python package that provides utilities to design backends serving HDF5 file content: attributes, metadata and data. HDF5 files are accessed with h5py.

Rationale

There are several packages out there that can serve HDF5 files. However, they are dedicated to their usecases and settle on one implementation, hampering reusability.

In addition, some problems arise constantly when designing HDF5 backends. To name a few:

  • Resolving external links
  • Dealing with compression and slicing of datasets
  • Encoding data efficiently and consistently (looking at you, NaN, Infinity in JSON)

h5grove aims at providing building blocks that solve these common problems and can be reused in existing or new backends.

Installation

pip install h5grove

You can use h5grove low-level utilities whatever the backend implementation you choose. We simply provide additional utilities for Tornado and Flask that can be installed with:

pip install h5grove[flask] # For Flask
pip install h5grove[tornado] # For Tornado

Contents

Example implementations using Flask and Tornado are given in the example folder. These are functional backends that make use of the utilities provided by the h5grove package.

For more tailored use, you can make use of the low-level utilities in your own project. The package contains the following modules:

  • content: A hierarchy of Content classes that extract the relevant information (be it attributes, metadata or data) from the file (resolving links if possible) and expose them through methods.

Ideally, getting the information from a path in the file should be as simple as:

with h5py.File(filepath, "r") as h5file:
    content = create_content(h5file, path)
    # Get metadata (valid for all entities)
    content.metadata()
    # Get data (only valid for datasets)
    content.data()
  • encoders: Functions that encode data and provide the appropriate headers to build request responses. The module provides a JSON and a binary encoder.
  • flaskutils: Utilities dedicated to Flask backends. Notably provides a Blueprint.
  • tornadoutils: Utilities dedicated to Tornado backends.

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

h5grove-0.0.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

h5grove-0.0.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file h5grove-0.0.1.tar.gz.

File metadata

  • Download URL: h5grove-0.0.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.13

File hashes

Hashes for h5grove-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2a68ce90e8f690b1a55ab39c8c67fca977f54d5fc320e2eaa45f664c5ccf4708
MD5 7a4c06e475fa1aa7bd8097eeac10bedf
BLAKE2b-256 369b500afc1d981d12ac1c65744677ae3f358b729799263bac3d2baecef6251f

See more details on using hashes here.

File details

Details for the file h5grove-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: h5grove-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.13

File hashes

Hashes for h5grove-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0f8b641696c99593bbd09e2b6481544d8721b81feab9fb4df3794beb9e00aa8
MD5 f0b1c4383aae1b6bc09dfe26b62ed6c9
BLAKE2b-256 bf0789cd9e9f1a7d62b3ef0f336d1cf58b9d730c797bd331364ec52a3359d7b3

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