Skip to main content

Data Files

Read and write data files across multiple formats.

This module provides a unified interface for file-based datasets and is intended to grow as more formats are added. Currently, it includes support for HDF5 via HDF5File/HDF5Group and plain text via TextFile.

Examples

HDF5File("data.h5")
.write("scalar/int", 5)
.write("scalar/real", 3.14)
.write("list/values", [1, 2, 3])
.write("list/flags", [true, false, true])

var g = HDF5File("data.h5").group("experiments")
g.write("run1/value", 42)
g.write_attribute("run1/value", "units", "arb")
g.list_datasets()

var f = TextFile("notes.txt", "w")
f.write("hello\n").append("world\n")
var lines = TextFile("notes.txt").read_lines()

Types

NameDescription
HDF5FileRepresents an HDF5 file handle.
HDF5GroupRepresents an HDF5 group.
TextFileRepresents a text file handle.