{"id":9803,"library":"h5grove","title":"H5Grove","description":"h5grove is a Python library providing core utilities to serve HDF5 file contents over a REST API. It allows users to browse and extract data from HDF5 files via HTTP requests, with support for various web frameworks like FastAPI, Flask, and Tornado. The library is actively maintained, with a current version of 4.0.0, and releases new versions regularly, often including breaking changes to improve the API or underlying structure.","status":"active","version":"4.0.0","language":"en","source_language":"en","source_url":"https://github.com/silx-kit/h5grove","tags":["HDF5","data server","REST API","file server","scientific data"],"install":[{"cmd":"pip install h5grove","lang":"bash","label":"Install core library"},{"cmd":"pip install h5grove[fastapi] uvicorn","lang":"bash","label":"Install with FastAPI backend and Uvicorn"}],"dependencies":[{"reason":"Core dependency for HDF5 file manipulation.","package":"h5py","optional":false}],"imports":[{"note":"create_app is a universal function in h5grove.app to create a server app for a given backend.","wrong":"from h5grove.backends.fastapi import create_app","symbol":"create_app","correct":"from h5grove.app import create_app"},{"symbol":"H5GroveConfig","correct":"from h5grove.config import H5GroveConfig"}],"quickstart":{"code":"import os\nfrom fastapi import FastAPI\nfrom h5grove.app import create_app\nfrom h5grove.config import H5GroveConfig\n\n# Configure the base directory for HDF5 files.\n# Replace with a path where your .h5 files are located.\n# For a runnable example, ensure a '.h5' file exists here.\nH5GroveConfig.hdf5_dir = os.environ.get('H5GROVE_HDF5_DIR', '.')\n\napp = FastAPI()\napp.mount(\"/h5grove\", create_app())\n\n# To run this app (requires uvicorn):\n# 1. pip install h5grove[fastapi] uvicorn\n# 2. Save this code as 'main.py'\n# 3. Run from terminal: uvicorn main:app --reload --port 8000\n# 4. Access API: http://127.0.0.1:8000/h5grove/","lang":"python","description":"This quickstart demonstrates setting up a basic h5grove server using FastAPI and Uvicorn. It mounts the h5grove API at the `/h5grove` path. Ensure you have the `h5grove[fastapi]` and `uvicorn` packages installed, and specify an `H5GROVE_HDF5_DIR` environment variable or directly set `H5GroveConfig.hdf5_dir` to point to a directory containing your HDF5 files. This allows the server to discover and serve them."},"warnings":[{"fix":"Update client-side parsing logic for `/meta` endpoint responses involving compound datasets to expect `members` as an array.","message":"In v4.0.0, the `/meta` endpoint response schema for compound datasets changed. The `members` key is now an array instead of an object to ensure correct field ordering.","severity":"breaking","affected_versions":"4.0.0+"},{"fix":"Update all API calls to remove trailing slashes from endpoint paths. Old endpoints with trailing slashes will result in 404 Not Found errors.","message":"In v3.0.0, trailing slashes were removed from all endpoints (e.g., `/attr/` is now `/attr`).","severity":"breaking","affected_versions":"3.0.0+"},{"fix":"Ensure your development and deployment environments are using Python 3.10 or a later version. Older Python versions will cause installation or runtime errors.","message":"Starting from v3.0.0, Python 3.10 or newer is required.","severity":"breaking","affected_versions":"3.0.0+"},{"fix":"Adjust client-side code that parses metadata responses to use `kind` instead of `type`, and to handle the new structured `type` object instead of a simple `dtype` string.","message":"In v2.0.0, the `type` field in all entities' metadata was renamed to `kind`, and the `dtype` field for dataset/attribute metadata was replaced with a richer `type` object (e.g., `{dtype: '<f8'}` became `{type: {'class': 1, 'dtype': '<f8', 'size': 8, 'order': 0}}`).","severity":"breaking","affected_versions":"2.0.0+"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Run `pip install h5grove` to install the core library, or `pip install h5grove[fastapi]` (or other backend) for full functionality.","cause":"The h5grove package has not been installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'h5grove'"},{"fix":"Update your API client requests to remove trailing slashes from all h5grove endpoints (e.g., change `/attr/` to `/attr`, `/data/` to `/data`).","cause":"From v3.0.0 onwards, h5grove endpoints no longer use trailing slashes.","error":"404 Not Found when accessing /attr/ or /data/"},{"fix":"Adjust your client-side code to parse the `members` key as an array rather than an object when requesting `/meta` for compound datasets from a v4.0.0+ h5grove server.","cause":"You are using h5grove v4.0.0+ but your client expects the 'members' key for compound dataset metadata to be an object, not an array.","error":"TypeError: 'dict' object is not subscriptable when parsing compound dataset metadata for 'members'"},{"fix":"Upgrade your Python environment to version 3.10 or newer. Alternatively, downgrade h5grove to a version compatible with your current Python version (e.g., `pip install 'h5grove<3.0.0'` for Python 3.8/3.9 or `h5grove<2.0.0` for Python 3.7).","cause":"Your Python environment does not meet the minimum version requirement for the installed h5grove package.","error":"RuntimeError: Python version 3.9 is not supported by h5grove version 3.0.0. Minimal version is 3.10."}]}