hydromt.data_catalog.DataCatalog.from_yml#

DataCatalog.from_yml(urlpath: Path | str, root: str | None = None, catalog_name: str | None = None, mark_used: bool = False) DataCatalog[source]#

Add data sources based on yaml file.

Parameters:
  • urlpath (str, Path) – Path or url to data source yaml files.

  • root (str, Path, optional) – Global root for all relative paths in yaml file(s).

  • mark_used (bool) – If True, append to used_data list.

Examples

A yaml data entry is provided below, where all the text between <> should be filled by the user. Multiple data sources of the same data type should be grouped. Currently the following data types are supported: {‘RasterDataset’, ‘GeoDataset’, ‘GeoDataFrame’}. See the specific data adapters for more information about the required and optional arguments.

meta:
  root: <path>
  category: <category>
  version: <version>
<name>:
  path: <path>
  data_type: <data_type>
  driver: <driver>
  filesystem: <filesystem>
  driver_kwargs:
    <key>: <value>
  nodata:
    <hydromt_variable_name1>: <nodata>
  rename:
    <native_variable_name1>: <hydromt_variable_name1>
    <native_variable_name2>: <hydromt_variable_name2>
  unit_add:
    <hydromt_variable_name1>: <float/int>
  unit_mult:
    <hydromt_variable_name1>: <float/int>
  meta:
    source_url: <source_url>
    source_version: <source_version>
    source_licence: <source_licence>
    paper_ref: <paper_ref>
    paper_doi: <paper_doi>
  placeholders:
    <placeholder_name_1>: <list of names>
    <placeholder_name_2>: <list of names>
Returns:

DataCatalog object with parsed yaml file added.

Return type:

DataCatalog