hydromt.data_catalog.DataCatalog#
- class hydromt.data_catalog.DataCatalog(data_libs: ~typing.List | str = [], fallback_lib: str | None = 'artifact_data', logger=<Logger hydromt.data_catalog (WARNING)>, cache: bool = False, cache_dir: str | None = None, **artifact_keys)[source]#
Base class for the data catalog object.
Catalog of DataAdapter sources.
Helps 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. Seefrom_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_dataartifact_keys – Deprecated from version v0.5
logger (
logger object
, optional) – The logger object used for logging messages. If not provided, the default logger will be used.
- __init__(data_libs: ~typing.List | str = [], fallback_lib: str | None = 'artifact_data', logger=<Logger hydromt.data_catalog (WARNING)>, cache: bool = False, cache_dir: str | None = None, **artifact_keys) None [source]#
Catalog of DataAdapter sources.
Helps 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. Seefrom_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_dataartifact_keys – Deprecated from version v0.5
logger (
logger object
, optional) – The logger object used for logging messages. If not provided, the default logger will be used.
Methods
__init__
([data_libs, fallback_lib, logger, ...])Catalog of DataAdapter sources.
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])Parse artifacts.
from_dict
(data_dict[, catalog_name, root, ...])Add data sources based on dictionary.
from_predefined_catalogs
(name[, version])Generate a catalogue from one of the predefined ones.
from_yml
(urlpath[, root, mark_used])Add data sources based on yaml file.
get_dataframe
(data_like[, variables, time_tuple])Return a unified and sliced DataFrame.
get_geodataframe
(data_like[, bbox, geom, ...])Return a clipped and unified GeoDataFrame (vector).
get_geodataset
(data_like[, bbox, geom, ...])Return a clipped, sliced and unified GeoDataset.
get_rasterdataset
(data_like[, bbox, geom, ...])Return a clipped, sliced and unified RasterDataset.
set_predefined_catalogs
([urlpath])Initialise the predefined catalogs.
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.
Return all predefined catalogs.
Returns dictionary of DataAdapter sources.