fs_dev.hooks.native_reader_hooks#

fs_dev.hooks.native_reader_hooks#

Post-processing hooks for native readers.

Add functions named hook_<native_function_name> to modify data after reading.

Example: def hook_read_ascii_csv(data: dict) -> dict:

# Add derived fields, unit conversion, validation, etc. return data

Functions#

  • fs_dev.hooks.native_reader_hooks.hook_read_ascii_csv()

  • fs_dev.hooks.native_reader_hooks.hook_read_ascii_csv_rs()

Function Reference#

hook_read_ascii_csv#

hook_read_ascii_csv(data: dict) dict#

Post-processing hook for read_ascii_csv().

This hook runs automatically after the native C++ reader returns.

Current behavior#

  • Injects a metadata field into the returned dataset

  • Marks the data source as coming from the C++ reader hook

Parameters#

datadict

Parsed dataset returned by the native reader.

Returns#

dict

The same dataset, augmented with metadata.

hook_read_ascii_csv_rs#

hook_read_ascii_csv_rs(data: dict) dict#

Post-processing hook for read_ascii_csv_rs().

This hook runs automatically after the native Rust reader returns.

Current behavior#

  • Injects a metadata field into the returned dataset

  • Marks the data source as coming from the Rust reader hook

Parameters#

datadict

Parsed dataset returned by the native reader.

Returns#

dict

The same dataset, augmented with metadata.