Doc2Dataset(index, products=None, exclude_products=None, fail_on_missing_lineage=False, verify_lineage=True, skip_lineage=False, eo3='auto')¶
Used for constructing Dataset objects from plain metadata documents.
This requires a database connection to perform the automatic matching against available products.
There are options for including and excluding the products to match against, as well as how to deal with source lineage.
Once constructed, call with a dictionary object and location URI, eg:
resolver = Doc2Dataset(index) dataset = resolver(dataset_dictionary, 'file:///tmp/test-dataset.json') index.dataset.add(dataset)
index – an open Database connection
products (list) – List of product names against which to match datasets (including lineage datasets). If not supplied we will consider all products.
exclude_products (list) – List of products to exclude from matching
fail_on_missing_lineage – If True fail resolve if any lineage datasets are missing from the DB
verify_lineage – If True check that lineage datasets in the supplied document are identical to DB versions
skip_lineage – If True ignore lineage sub-tree in the supplied document and construct dataset without lineage datasets
eo3 – ‘auto’/True/False by default auto-detect EO3 datasets and pre-process them
__init__(index, products=None, exclude_products=None, fail_on_missing_lineage=False, verify_lineage=True, skip_lineage=False, eo3='auto')¶
Initialize self. See help(type(self)) for accurate signature.
__init__(index[, products, …])