ssapy_toolkit.IO.hdf5_to_csv

h5_to_csv.py

Library + script:

  • Import and call: hdf5_to_csv_per_key(“input.h5”)

  • Or run directly: python h5_to_csv.py (uses the hard-coded path in main()).

Functions

dataset_to_python(ds)

hdf5_to_csv_per_key(h5_filename, *[, encoding])

Callable API (for importing).

iter_datasets(h5)

key_to_filename(key[, max_len])

main()

normalize_grid(grid)

place_cell(grid, r, c, val)

write_block(grid, top, left, key, arr2d)

write_column(grid, top, col, key, values)

write_dataset_csv(out_path, key, data[, ...])

Returns (written, warning).

write_grid_csv(path, grid[, encoding])

ssapy_toolkit.IO.hdf5_to_csv.dataset_to_python(ds: Dataset) Any[source]
ssapy_toolkit.IO.hdf5_to_csv.hdf5_to_csv_per_key(h5_filename: str | Path, *, encoding: str = 'utf-8') Path[source]

Callable API (for importing).

Always: - creates directory <input_stem>/ next to the input file - writes one CSV per dataset key path inside that directory

Returns:

Path to the output directory.

ssapy_toolkit.IO.hdf5_to_csv.iter_datasets(h5: File) List[Tuple[str, Dataset]][source]
ssapy_toolkit.IO.hdf5_to_csv.key_to_filename(key: str, max_len: int = 180) str[source]
ssapy_toolkit.IO.hdf5_to_csv.main() None[source]
ssapy_toolkit.IO.hdf5_to_csv.normalize_grid(grid: List[List[str]]) List[List[str]][source]
ssapy_toolkit.IO.hdf5_to_csv.place_cell(grid: List[List[str]], r: int, c: int, val: str) None[source]
ssapy_toolkit.IO.hdf5_to_csv.write_block(grid: List[List[str]], top: int, left: int, key: str, arr2d: Any) Tuple[int, int][source]
ssapy_toolkit.IO.hdf5_to_csv.write_column(grid: List[List[str]], top: int, col: int, key: str, values: List[Any]) int[source]
ssapy_toolkit.IO.hdf5_to_csv.write_dataset_csv(out_path: Path, key: str, data: Any, encoding: str = 'utf-8') Tuple[bool, str | None][source]

Returns (written, warning). written=False if skipped due to ndim>2.

ssapy_toolkit.IO.hdf5_to_csv.write_grid_csv(path: Path, grid: List[List[str]], encoding: str = 'utf-8') None[source]