rics.translation.types#
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. |
Classes
TypeVar(name, *constraints[, bound, ...]) |
Type variable. |
- Translatable#
Enumeration of translatable types.
alias of TypeVar(‘Translatable’, pandas.DataFrame, pandas.Series, ~typing.Dict, ~typing.Sequence, str, int)
- NameType#
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)
- IdType#
Type of the value being translated into human-readable labels.
alias of TypeVar(‘IdType’, int, str)
- SourceType#
Type used to describe sources. Typically a string for things like files and database tables.
alias of TypeVar(‘SourceType’, bound=
Hashable)
- ExtendedOverrideFunction#
Signature for a user-defined override function.
- Parameters
name – A name to create a name-to-source match for.
sources – Potential matches for name.
ids – IDs for name.
- Returns
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.UserOverrideFunctiontype.alias of
Callable[[NameType,Set[SourceType],List[IdType]],Optional[Union[SourceType,Dict[SourceType,List[IdType]]]]]
- NameTypes#
A union of a name type, or an iterable thereof.