https://github.com/kennethnym/h5serve
A prototype of a FastAPI server serving remote hdf5 files
https://github.com/kennethnym/h5serve
Last synced: 2 months ago
JSON representation
A prototype of a FastAPI server serving remote hdf5 files
- Host: GitHub
- URL: https://github.com/kennethnym/h5serve
- Owner: kennethnym
- Created: 2022-09-01T16:22:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-02T10:59:48.000Z (over 2 years ago)
- Last Synced: 2025-01-20T06:45:34.697Z (4 months ago)
- Language: Python
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# h5 serve
A FastAPI server that serves requested HDF5 files## Prerequisites
- `poetry`
- Python `^3.10`## How it works
It uses `h5groove`'s provided FastAPI router for interfacing with `@h5web/app`'s preview frontend.
However, it requires that the HDF5 files to be on the local filesystem of the server.`h5serve` provides 2 additional endpoints, `POST /request` and `GET /request/{request_id}`.
`POST /request` is for requesting an HDF5 file to be previewed. The server will begin downloading the HDF5 file to `./hdf5_files/{name}`.
`GET /request/{request_id}` returns the request object, containing the status of the request, and the path to the HDF5 file relative to `./hdf5_files` when the request is complete.Once the file has been downloaded, client can supply the file path returned by the server to `@h5web/app`. It can then interact with this server as normal.
## Running the server
1. `poetry install`
2. `poetry run uvicorn main:app --reload`
3. Server is now running on `localhost:8000`