rics.translation.fetching.types#

Types related to translation fetching.

Functions

dataclass([cls, init, repr, eq, order, ...])

Returns the same class as was passed in, with dunder methods added based on the fields defined in the class.

Classes

FetchInstruction(source, ids, placeholders, ...)

Instructions passed from an AbstractFetcher to an implementation.

Generic(*args, **kwds)

Abstract base class for generic types.

IdsToFetch(source, ids)

A source and the IDs to fetch from it.

class IdsToFetch(source: SourceType, ids: Optional[Iterable[IdType]])[source]#

Bases: Generic[SourceType, IdType]

A source and the IDs to fetch from it.

source: SourceType#

Where to fetch from.

ids: Optional[Iterable[IdType]]#

Unique IDs to fetch translations for. Fetch as much as possible if None

class FetchInstruction(source: SourceType, ids: Optional[Iterable[IdType]], placeholders: Tuple[str, ...], required: Set[str], all_placeholders: bool)[source]#

Bases: IdsToFetch[SourceType, IdType]

Instructions passed from an AbstractFetcher to an implementation.

placeholders: Tuple[str, ...]#

All desired placeholders in preferred order.

required: Set[str]#

Placeholders that must be included in the response.

all_placeholders: bool#

Flag indicated whether to retrieve as many placeholders as possible.