hydromt.data_catalog.drivers.BaseDriver#
- pydantic model hydromt.data_catalog.drivers.BaseDriver[source]#
Base class for different drivers.
Is used to implement common functionality.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
- field filesystem: FSSpecFileSystem [Optional]#
Filesystem to use for accessing the data.
- field options: DriverOptions [Optional]#
Driver options that can be used to configure the behavior of the driver. DriverOptions allows for setting arbitrary kwargs. Any options not explicitly declared in the DriverOptions class are passed as kwargs to the underlying open functions.
- abstract read(uris: list[str], *, handle_nodata: NoDataStrategy = NoDataStrategy.RAISE) Any[source]#
Read data using the driver.
- Parameters:
uris (
list[str]) – List of URIs to read data from.handle_nodata (
NoDataStrategy, optional) – Strategy to handle no data situations. Default is NoDataStrategy.RAISE.
- abstract write(path: Path | str, data: Any, *, write_kwargs: dict[str, Any] | None = None) Path[source]#
Write data using the driver.
- Parameters:
path (
Path | str) – Destination path where the data will be written. Can be a local or remote URI.data (
Any) – The data object to write. The expected type depends on the specific driver implementation (e.g., pandas DataFrame, xarray Dataset, GeoDataFrame, etc.).write_kwargs (
dict[str,Any], optional) – Additional keyword arguments passed to the underlying writer function (e.g., to_csv, to_zarr, etc.). Default is None.
- Returns:
The path where the data was written.
- Return type:
Path