Read-only Textual viewer for HDF5 files
Project description
viewh5
Read-only, keyboard-first HDF5 viewer built with Textual.
Install
uv tool install viewh5
Or install the latest version directly from GitHub:
uv tool install --from git+https://github.com/kabilan108/viewh5 viewh5
Run it with viewh5 open path/to/file.h5.
For a non-interactive summary, use:
viewh5 describe path/to/file.h5
Yazi Previews
viewh5 can be used as both the HDF5 opener and the previewer in Yazi. The preview flow is built around piper.yazi, which runs viewh5 describe and shows the resulting text in Yazi's preview pane.
- Install
viewh5so theviewh5command is on yourPATH.
uv tool install viewh5
- Install the
piper.yaziplugin:
ya pkg add yazi-rs/plugins:piper
- Add the opener and preview rules to
~/.config/yazi/yazi.toml:
[opener]
h5 = [
{ run = 'viewh5 open "$@"', block = true, desc = "View HDF5 file" },
]
[open]
prepend_rules = [
{ url = "*.h5", use = [ "h5" ] },
{ url = "*.hdf5", use = [ "h5" ] },
{ url = "*.hdf", use = [ "h5" ] },
]
[plugin]
prepend_previewers = [
{ url = "*.h5", run = 'piper -- viewh5 describe --width "$w" --height "$h" "$1"' },
{ url = "*.hdf5", run = 'piper -- viewh5 describe --width "$w" --height "$h" "$1"' },
{ url = "*.hdf", run = 'piper -- viewh5 describe --width "$w" --height "$h" "$1"' },
]
After restarting Yazi, open on an HDF5 file will launch the full Textual app and hovering an HDF5 file will show the text summary in the preview pane.
Home Manager Setup
If you manage Yazi with Home Manager, the relevant configuration looks like:
programs.yazi = {
enable = true;
enableBashIntegration = true;
plugins = {
piper = pkgs.yaziPlugins.piper;
};
settings = {
opener = {
h5 = [
{ run = ''viewh5 open "$@"''; block = true; desc = "View HDF5 file"; }
];
};
open = {
prepend_rules = [
{ url = "*.h5"; use = [ "h5" ]; }
{ url = "*.hdf5"; use = [ "h5" ]; }
{ url = "*.hdf"; use = [ "h5" ]; }
];
};
plugin = {
prepend_previewers = [
{ url = "*.h5"; run = ''piper -- viewh5 describe --width "$w" --height "$h" "$1"''; }
{ url = "*.hdf5"; run = ''piper -- viewh5 describe --width "$w" --height "$h" "$1"''; }
{ url = "*.hdf"; run = ''piper -- viewh5 describe --width "$w" --height "$h" "$1"''; }
];
};
};
};
After rebuilding Home Manager, open on an HDF5 file will launch the full Textual app and hovering an HDF5 file will show the text summary in Yazi's preview pane.
Development
uv sync
uv run pytest
uv run ruff check
uv run ty check
uv run viewh5 open data/1520.h5
vhs assets/viewh5-demo.tape
To update snapshots after making changes to the TUI:
uv run pytest tests/test_snapshots.py --snapshot-update
To recreate the demo, make sure the project environment is synced and data/waveforms.h5 is present, then run vhs assets/viewh5-demo.tape.
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
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 viewh5-0.2.1.tar.gz.
File metadata
- Download URL: viewh5-0.2.1.tar.gz
- Upload date:
- Size: 595.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7026adf853b371151f13e1bd7e07a05273f0acba8bda1d2505d52a923ce732cd
|
|
| MD5 |
123b2c486a89e3807d0ccb8a4dece8e2
|
|
| BLAKE2b-256 |
42edf68068b957f55e6aad8ac4212f47f513d7116b7c36b05d18814ede8f863b
|
File details
Details for the file viewh5-0.2.1-py3-none-any.whl.
File metadata
- Download URL: viewh5-0.2.1-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc4e210e86ebc1153e9b01f53beba796012989777067ccaf74e3c237fb2c9eb1
|
|
| MD5 |
40a32b1e0bd9b17bebd894d1c08c0f43
|
|
| BLAKE2b-256 |
fb109c733da3a1fb9c32ddbd3594b87d7b36910ecdcf477a38647f964af1b106
|