readHdf(data, options?) and toHdf(df, options?)
implement a pure-TypeScript HDF5 v0 Superblock reader and writer with no
native dependencies. Each file encodes a single DataFrame under a
configurable HDF5 group key (default "df"). The format is compatible
with pandas.read_hdf() / DataFrame.to_hdf().
Serialize a DataFrame to an HDF5 binary buffer with
toHdf() and read it back with readHdf().
The buffer begins with the standard HDF5 magic bytes
0x89 HDF\r\n\x1a\n.
HDF5 stores numeric types as contiguous fixed-width binary arrays. Booleans are stored as UInt8 (0 or 1). Strings are fixed-length null-padded UTF-8 — the element size is the byte length of the longest string in the column.
The HDF5 group key specifies where within the file the DataFrame is stored.
The default is "df". A leading / is stripped
automatically (both in write and read).
Pass usecols to read only a subset of columns from the file.
Unselected columns are skipped during dataset parsing.
Use writeIndex: true to store the DataFrame's row index as an
extra column named __index__. When reading back, pass
indexCol: "__index__" to restore it as the row index.
Strings are stored as fixed-length null-padded UTF-8 arrays. The element size is the byte length of the longest encoded string. Any Unicode string — including emoji, CJK, and accented characters — round-trips exactly.
IEEE 754 special values round-trip correctly since the data is stored as raw binary float64 without any encoding layer.