Types used for translation.
Module Attributes
Enumeration of translatable types. |
|
Name of the ID placeholder. |
|
Type used to label collections of IDs, such as the column names in a DataFrame or the keys of a dict. |
|
Type of the value being translated into human-readable labels. |
|
Type used to describe sources. |
|
Signature for a user-defined override function. |
|
A predicate type on names. |
|
A union of a name type, or an iterable thereof. |
|
Acceptable name types. |
Enumeration of translatable types.
The only truly Translatable types are int and str. Working with single IDs is
rarely efficient in practice, so collections such as sequences (lists, tuples, numpy arrays) and dict values of
sequences of primitives (or plain primitives) may be translated as well. Special handling is also implemented for
pandas types.
alias of TypeVar(‘Translatable’, str, int, ~typing.Dict, ~typing.Sequence, NDArray, pandas.DataFrame, pandas.Index, pandas.Series)
Type used to label collections of IDs, such as the column names in a DataFrame or the keys of a dict.
alias of TypeVar(‘NameType’, bound=Hashable)
Type of the value being translated into human-readable labels.
alias of TypeVar(‘IdType’, int, str)
Type used to describe sources. Typically a string for things like files and database tables.
alias of TypeVar(‘SourceType’, bound=Hashable)
Signature for a user-defined override function.
name – A name to create a name-to-source match for.
sources – Potential matches for name.
ids – IDs for name.
Either None (let regular logic decide), a dict, or a source.
If a dict, it is expected to be on the form {source: [ids_for_source..]}.
See also
The rics.mapping.types.UserOverrideFunction type.
alias of Callable[[NameType, Set[SourceType], List[IdType]], Optional[Union[SourceType, Dict[SourceType, List[IdType]]]]]
A union of a name type, or an iterable thereof.