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.3.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

h5grove-0.0.3-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: h5grove-0.0.3.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.14

File hashes

Hashes for h5grove-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6b363edab967b07c092ee600e1112e15458d74e09436aa8bf5c3b3f1e695232c
MD5 9d8655a739f9f987f9264e5d6c49f227
BLAKE2b-256 ac9f5ee2962208b47848514fe90ffba3863d28bc0aca08bb4e3e342a72e71939

See more details on using hashes here.

File details

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

File metadata

  • Download URL: h5grove-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.14

File hashes

Hashes for h5grove-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 94e6d79d598b5183b464a2cc893cbe681c4facb1ab4b12d7d083124e7d987268
MD5 9f1897607cf588226437bfde122a6896
BLAKE2b-256 68ff7364962b6e88caa2d0df19be55b84a0d96f779b3e7333fbf2b23d733b8d2

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