eomatch.enrich.enrich

Contents

eomatch.enrich.enrich#

eomatch.enrich.enrich(catalogue, enrichers: Iterable[Callable[[Matchup], Dict[str, Any]]], overwrite: bool = False) int[source]#

Apply enrichers to every matchup item in catalogue.

For each matchup STAC Item the function:

  1. Reconstructs the Matchup domain object from the item’s derived_from links.

  2. Calls every enricher with the Matchup and merges the returned dicts.

  3. Writes the new key/value pairs back to item.properties (skipping keys that already exist unless overwrite is True).

  4. Saves the updated item JSON to disk (if the item has a self_href).

Enrichers that raise an exception are logged as warnings and skipped for that item, so a single failure does not abort the whole run.

Parameters:
  • catalogueMatchupCatalogue to enrich.

  • enrichers – iterable of enricher callables.

  • overwrite – when True, existing property values are replaced; when False (default), existing properties are kept unchanged.

Returns:

number of matchup items enriched.