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 ofContent
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file h5grove-0.0.2.tar.gz
.
File metadata
- Download URL: h5grove-0.0.2.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22fadcf58cabeacaa11d2abd675b673bf40c697338b2c64259c593928d4c9e94 |
|
MD5 | 02b9fb955fc6bd81c34cefe4616e1b62 |
|
BLAKE2b-256 | 4178ecc36c5cd275519fd112ef2e658c040b348487c18da9d4f8656317227b3d |
File details
Details for the file h5grove-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: h5grove-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 022432cf53bd7399d99a36b28355cc2bca143c580545d9092f5992821ce45a6d |
|
MD5 | a8cd209ada442ad05d2f8f3a6fb5d7be |
|
BLAKE2b-256 | 78ca49999491e4f1bf245905f52b973529fc854c710bbec40a01a6d6ec584644 |