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:
Reconstructs the
Matchupdomain object from the item’sderived_fromlinks.Calls every enricher with the
Matchupand merges the returned dicts.Writes the new key/value pairs back to
item.properties(skipping keys that already exist unless overwrite isTrue).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:
catalogue –
MatchupCatalogueto enrich.enrichers – iterable of enricher callables.
overwrite – when
True, existing property values are replaced; whenFalse(default), existing properties are kept unchanged.
- Returns:
number of matchup items enriched.