sddb.resolve#

sddb.resolve(names: Iterable[str], roles: Mapping[str, str]) → dict[str, str]#

Resolve each role to exactly one element path.

Parameters:
names

Element paths as "kind/name" (the keys of sddb.Dataset.elements()).

roles

Role name to regex, matched with re.search() against each path.

Returns:

dict Role name to the single matching path.

Raises:
  • KeyError -- If a role matches nothing; the message lists the paths of the kind the pattern targets (a leading ^kind/), or all paths when the pattern names no kind.

  • ValueError -- If a role matches more than one path; the message lists them.