id_translation.mapping.types#
Types used for mapping.
Module Attributes
Hashable type on the left side of a directional relationship. |
|
Hashable type on the right side of a directional relationship. |
|
A left-to-right mapping. |
|
A right-to-left mapping. |
|
A type of item being mapped. |
|
A type of item being mapped. |
|
A tuple of candidates matched to a value. |
|
Type of context in which mapping is being performed. |
|
Signature for a user-defined override function. |
|
Signature for a likeness score function. |
|
Signature for an alias function for heuristic scoring. |
|
Signature for a filter function. |
|
Types that may be interpreted as a score function heuristic. |
|
Action types for unmapped values. |
|
Action types for bad user overrides (dict or function). |
- AliasFunction#
Signature for an alias function for heuristic scoring.
- Parameters:
value – An element to find matches for.
candidates – Potential matches for value.
context – The context in which mapping is being performed.
- Keyword Arguments:
kwargs – Accepted only by some functions.
- Returns:
A tuple (name, candidates) with applied heuristics to increase (or decrease) score as desired.
alias of
Callable[[ValueType,Iterable[CandidateType],ContextType|None],tuple[ValueType,Iterable[CandidateType]]]
- class ContextType#
Type of context in which mapping is being performed.
alias of TypeVar(‘ContextType’, bound=
Hashable)
- FilterFunction#
Signature for a filter function.
- Parameters:
value – An element to find matches for.
candidates – Potential matches for value.
context – The context in which filtering is being performed.
- Keyword Arguments:
kwargs – Accepted only by some functions.
- Returns:
A subset of candidates to keep.
alias of
Callable[[ValueType,Iterable[CandidateType],ContextType|None],set[CandidateType]]
- class HL#
Hashable type on the left side of a directional relationship.
alias of TypeVar(‘HL’, bound=
Hashable)
- class HR#
Hashable type on the right side of a directional relationship.
alias of TypeVar(‘HR’, bound=
Hashable)
- HeuristicsTypes = collections.abc.Callable[[~ValueType, collections.abc.Iterable[~CandidateType], ~ContextType | None], tuple[~ValueType, collections.abc.Iterable[~CandidateType]]] | collections.abc.Callable[[~ValueType, collections.abc.Iterable[~CandidateType], ~ContextType | None], set[~CandidateType]]#
Types that may be interpreted as a score function heuristic.
- MatchTuple#
A tuple of candidates matched to a value.
alias of
tuple[CandidateType, …]
- OnUnknownUserOverride#
Action types for bad user overrides (dict or function).
alias of
Literal[‘raise’, ‘warn’, ‘keep’]
- ScoreFunction#
Signature for a likeness score function.
- Parameters:
value – An element to find matches for.
candidates – Potential matches for value.
context – The context in which scoring is being performed.
- Keyword Arguments:
kwargs – Accepted only by some functions.
- Yields:
A score for each candidate c in candidates.
alias of
Callable[[ValueType,Iterable[CandidateType],ContextType|None],Iterable[float]]
- UserOverrideFunction#
Signature for a user-defined override function.
- Parameters:
value – An element to find matches for.
candidates – Potential matches for value.
context – The context in which scoring is being performed.
- Returns:
Either
None(let regular logic decide) or a single candidate c in candidates.
alias of
Callable[[ValueType,set[CandidateType],ContextType|None],CandidateType|None]