A simple command-line tool to convert HDF5 files to markdown format. This tool helps you visualize the structure, metadata, and attributes of HDF5 files in a human-readable markdown format.
- Convert HDF5 files to markdown format
- Display file structure including groups and datasets
- Show dataset properties (shape, type)
- List attributes for groups and datasets
- Clean and readable markdown output
# Clone the repository
git clone https://github.com/hyoklee/h5md.git
cd h5md
# Install in development mode
pip install -e .
Or install directly from GitHub:
pip install git+https://github.com/hyoklee/h5md.git
Convert an HDF5 file to markdown:
h5md input.h5
This will create input.md
in the same directory. You can also specify a custom output path:
h5md input.h5 -o output.md
from h5md import HDF5Converter
# Create a converter
converter = HDF5Converter()
# Convert HDF5 to markdown
markdown_content = converter.convert('input.h5')
# Save to file
with open('output.md', 'w') as f:
f.write(markdown_content)
The generated markdown file includes:
- File structure with groups and datasets
- Dataset properties (shape, type)
- Group and dataset attributes
- Nicely formatted tables for metadata
Example output:
# HDF5 File Structure: input.h5
## Group: data
### Attributes:
| Name | Value | Type |
|------|--------|------|
| `purpose` | `testing` | `str` |
### Dataset: array
| Property | Value |
|----------|--------|
| Shape | `(3,)` |
| Type | `float64` |
#### Dataset Attributes:
| Name | Value | Type |
|------|--------|------|
| `unit` | `meters` | `str` |
- Python 3.10+
- h5py
- numpy
BSD 3-Clause License
Copyright (c) 2025, Joe Lee All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.