hydromt.data_catalog.DataCatalog#
- class hydromt.data_catalog.DataCatalog(data_libs: ~typing.Union[~typing.List, str] = [], fallback_lib: ~typing.Optional[str] = 'artifact_data', logger=<Logger hydromt.data_catalog (WARNING)>, cache: bool = False, cache_dir: ~typing.Optional[str] = None, **artifact_keys)[source]#
Catalog of DataAdapter sources to easily read from different files and keep track of files which have been accessed.
- Parameters:
data_libs ((list of) str, Path, optional) – One or more paths to data catalog yaml files or names of predefined data catalogs. By default the data catalog is initiated without data entries. See
from_yml()
for accepted yaml format.fallback_lib – Name of pre-defined data catalog to read if no data_libs are provided, by default ‘artifact_data’. If None, no default data catalog is used.
cache (bool, optional) – Set to true to cache data locally before reading. Currently only implemented for tiled rasterdatasets, by default False.
cache_dir (str, Path, optional) – Folder root path to cach data to, by default ~/.hydromt_data
artifact_keys – Deprecated from version v0.5
- __init__(data_libs: ~typing.Union[~typing.List, str] = [], fallback_lib: ~typing.Optional[str] = 'artifact_data', logger=<Logger hydromt.data_catalog (WARNING)>, cache: bool = False, cache_dir: ~typing.Optional[str] = None, **artifact_keys) None [source]#
Catalog of DataAdapter sources to easily read from different files and keep track of files which have been accessed.
- Parameters:
data_libs ((list of) str, Path, optional) – One or more paths to data catalog yaml files or names of predefined data catalogs. By default the data catalog is initiated without data entries. See
from_yml()
for accepted yaml format.fallback_lib – Name of pre-defined data catalog to read if no data_libs are provided, by default ‘artifact_data’. If None, no default data catalog is used.
cache (bool, optional) – Set to true to cache data locally before reading. Currently only implemented for tiled rasterdatasets, by default False.
cache_dir (str, Path, optional) – Folder root path to cach data to, by default ~/.hydromt_data
artifact_keys – Deprecated from version v0.5
Methods
__init__
([data_libs, fallback_lib, logger, ...])Catalog of DataAdapter sources to easily read from different files and keep track of files which have been accessed.
export_data
(data_root[, bbox, time_tuple, ...])Export a data slice of each dataset and a data_catalog.yml file to disk.
from_archive
(urlpath[, version, name])Read a data archive including a data_catalog.yml file
from_artifacts
([name, version])Deprecated method.
from_dict
(data_dict[, catalog_name, root, ...])Add data sources based on dictionary.
from_predefined_catalogs
(name[, version])from_yml
(urlpath[, root, mark_used])Add data sources based on yaml file.
get_dataframe
(path_or_key[, variables, ...])get_geodataframe
(path_or_key[, bbox, geom, ...])Returns a clipped and unified GeoDataFrame (vector) from the data catalog.
get_geodataset
(path_or_key[, bbox, geom, ...])Returns a clipped, sliced and unified GeoDataset from the data catalog.
get_rasterdataset
(path_or_key[, bbox, geom, ...])Returns a clipped, sliced and unified RasterDataset from the data catalog.
set_predefined_catalogs
([urlpath])to_dataframe
([source_names])Return data catalog summary as DataFrame
to_dict
([source_names, root, meta])Export the data catalog to a dictionary.
to_yml
(path[, root, source_names, ...])Write data catalog to yaml format.
update
(**kwargs)Add data sources to library.
Attributes
Returns list of data source names.
Returns dictionary of DataAdapter sources.