TUI application for navigating and viewing HDF5 files
Project description
Description
h5tui is a terminal user interface (TUI) application for viewing the contents of HDF5 files, a binary file format prevalent in scientific computing and data science, straight in the terminal.
Its design is inspired by vim-motion-enabled terminal file managers, such as ranger, lf and yazi.
This choice is natural since the HDF5 file format also adopts a directory structure for storing the data.
This project wouldn't have been possible without h5py for reading the HDF5 files, textual for building the UI, and plotext for plotting data straight in the terminal.
Demo
https://github.com/user-attachments/assets/356225e7-e2ab-457a-8e47-97c19efb5aaa
Installation
The package is hosted on PyPI and can be installed using pip:
pip install h5tui
Usage
Simply launch the application with an HDF5 file as an argument:
h5tui file.h5
File Navigation
h5tui starts at the root of the file and displays the contents of the root HDF5 group.
The directory structure can be navigated using the arrow or standard vim motion keys, with the up/down (j/k) moving the cursor inside the current group, and left/right (h/l) for going to the parent or child HDF5 group.
If the selected element is not an HDF5 group but an HDF5 dataset, then the dataset is displayed.
If the entire dataset does not fit on the screen, it can be scrolled using the up/down j/k keybindings.
Plotting
h5tui provides convenient terminal plotting facilities using the plotext library.
1D arrays are displayed as scatter plots, and 2D arrays are shown as heatmaps. Higher dimensional tensors are not currently supported.
The plotting can be toggled through the p keybinding while viewing a dataset.
Aggregation
h5tui also has limited data aggregation facilities for summarizing datasets.
This can be activated through the a keybinding while viewing a dataset.
Currently, this option will compute the min, max, and mean of the dataset but further statistics may be added in the future.
Dataset Format Options
The formatting of the dataset may be controlled using a couple of keybindings.
Since HDF5 files often contain large datasets which, by default, will truncate the output if the number of elements exceeds 1000 (that is the numpy default).
This behavior can be toggled using the t keybinding to display the entire dataset.
Note that, currently, this operation is blocking, and therefore huge datasets might take some time to load.
In addition, the s key toggles the scientific notation on and off (corresponding to the suppress option in numpys printing configuration).
Formatting keybindings:
t: toggle output truncations: toggle scientific notation
Limitations
- There is no support for displaying HDF5 attributes (mostly because the HDF5 files that I work with don't rely on them). However, if there is demand, this functionality can be added.
- There is no editing functionality, the contents of the HDF5 file cannot be modified through
h5tui. - I have only tested dataset viewing and plotting for primitive types (strings, ints, floats) and arrays. Please let me know if you encounter any issues.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file h5tui-0.1.6.tar.gz.
File metadata
- Download URL: h5tui-0.1.6.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c87cb1b352042ba807ec15095282cf218d25849a9d17ebeeb369f446ac9a235
|
|
| MD5 |
62e177c4d83be6e3efc7d21127b40e8d
|
|
| BLAKE2b-256 |
7bcc8349627248b3102c8ee4b2280b686e0723070181470440d5a2424cf0acec
|
File details
Details for the file h5tui-0.1.6-py3-none-any.whl.
File metadata
- Download URL: h5tui-0.1.6-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccdc1cbe1ba209e1fa24e17f75e55612e979ca165fb82e78492124457ef18ecc
|
|
| MD5 |
1d80828939281cae09afc532eabffb3a
|
|
| BLAKE2b-256 |
7676029e77810236058be8f5144c8cc1fabb65d031262683dbba64d9b7212da4
|