bridge.pipelines.protocols.map module#
Abstract class for mapping between repository and metadata models.
- class bridge.pipelines.protocols.map.MapItem(**data)[source]#
Bases:
BaseModelMap metadata property to corresponding repository metadata property and match method.
- Parameters:
schema_entry (Any)
repo_entry (Any)
method (Method | None)
fn (Callable[[Any, Any], Any] | None)
- classmethod ensure_callable_or_none(v)[source]#
Validate that fn is either None, a callable, or a dotted path to a callable.
-
fn:
Callable[[Any,Any],Any] |None#
-
repo_entry:
Any#
- async run()[source]#
Run the mapping function if provided, otherwise return None.
- Returns:
The result of the mapping function or None.
- Return type:
Any
-
schema_entry:
Any#
- class bridge.pipelines.protocols.map.Method(*values)[source]#
Bases:
EnumMatching method for mapping metadata record from one platform to another (GitHub, bio.tools).
- class bridge.pipelines.protocols.map.ModelsMap(repo, metadata)[source]#
Bases:
ABCAbstract class for mapping between repository and metadata models.
- Parameters:
repo (Any) – A repository model instance.
metadata (Any) – A metadata model instance.
- abstract property map: dict[str, Any]#
Perform the mapping between repository and metadata models.
- Returns:
The map representation of the models.
- Return type:
Any