hydromt.data_catalog.DataCatalog.from_dict#

DataCatalog.from_dict(data_dict: Dict, catalog_name: str = '', root: str | Path | None = None, category: str | None = None, mark_used: bool = False) DataCatalog[source]#

Add data sources based on dictionary.

Parameters:
  • data_dict (dict) – Dictionary of data_sources.

  • catalog_name (str, optional) – Name of data catalog

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

  • category (str, optional) – Global category for all sources in data_dict.

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

Examples

A data dictionary with two entries is provided below, where all the text between <> should be filled by the user. See the specific data adapters for more information about the required and optional arguments.

{
    <name1>: {
        "path": <path>,
        "data_type": <data_type>,
        "driver": <driver>,
        "filesystem": <filesystem>,
        "driver_kwargs": {<key>: <value>},
        "nodata": <nodata>,
        "rename": {<native_variable_name1>: <hydromt_variable_name1>},
        "unit_add": {<hydromt_variable_name1>: <float/int>},
        "unit_mult": {<hydromt_variable_name1>: <float/int>},
        "meta": {...},
        "placeholders": {<placeholder_name_1>: <list of names>},
    }
    <name2>: {
        ...
    }
}