datacube.index.hl.Doc2Dataset

class datacube.index.hl.Doc2Dataset(index, products=None, exclude_products=None, fail_on_missing_lineage=False, verify_lineage=True, skip_lineage=False)[source]

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)
Parameters:
  • 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
  • index – Database
  • products – List of product names against which to match datasets (including lineage datasets), if not supplied will consider all products.
  • exclude_products – 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
__init__(index, products=None, exclude_products=None, fail_on_missing_lineage=False, verify_lineage=True, skip_lineage=False)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(index[, products, …]) Initialize self.