hydromodpy.data.common.io_helpers#

I/O helpers: CSV, Parquet, SHP/GPKG readers and filename conventions.

Functions

is_scaffold_example(path)

True for the format templates shipped by hmp workspace init.

parse_chronicle_filename(filename)

Parse TYPE_SOURCE_ID_YYYYMMDD_YYYYMMDD_FREQ.ext, return groups or None.

parse_datetime_column(series)

Parse datetime column (ISO strings or Unix timestamps ms/s).

parse_loc_filename(filename)

Parse TYPE_SOURCE_LOC.ext, return groups or None.

read_locations(path, *[, col_id, col_x, ...])

Auto-detect format and read locations.

read_locations_csv(path, *[, col_id, col_x, ...])

Read CSV location file into StationLocation list.

read_locations_vector(path, *[, col_id])

Read SHP/GeoPackage location file.

read_parquet(path)

read_timeseries_csv(path, *[, col_datetime, ...])

Read chronicle CSV and normalize to [datetime, value] columns.

safe_file_token(value)

Replace non-alphanumeric chars with underscore for safe filenames.

write_parquet(df, path)

Write DataFrame to Parquet.