rics.translation.fetching.support#
Supporting functions for implementations.
Functions
|
Create |
|
Select from a subset of known placeholders. |
- from_records(instr: FetchInstruction[SourceType, IdType], known_placeholders: Collection[str], records: Sequence[Sequence[Any]]) PlaceholderTranslations[source]#
Create
PlaceholderTranslationsinstance from records.Convenience method meant for use by implementations.
- Parameters
instr – A fetch instruction.
known_placeholders – Known placeholders for the instr.source.
records – Records produced from the instruction.
- Returns
Placeholder translation elements.
- Raises
ImplementationError – If the underlying
Fetcherdoes not return enough IDs.
- select_placeholders(instr: FetchInstruction[SourceType, IdType], known_placeholders: Collection[str]) List[str][source]#
Select from a subset of known placeholders.
- Parameters
instr – Instruction object with placeholders.
known_placeholders – A collection of known placeholders.
- Returns
As many known placeholders from instr as possible.