bridge.pipelines.gh2bt_for_meta.map_funcs.biotools_id module#
Map GitHub repository name to bio.tools ID.
This module reconciles the GitHub repository name with the bio.tools ID. It applies a policy that prefers the GitHub name while ensuring uniqueness within bio.tools, generating alternative IDs if necessary.
- async bridge.pipelines.gh2bt_for_meta.map_funcs.biotools_id.map_biotools_id(gh_name, bt_id)[source]#
Map and reconcile GitHub repository name to bio.tools ID.
Policy: 1. If no GitHub repo name is available, preserve existing bio.tools ID (even if None). 2. If the existing bio.tools ID and GitHub repo name contain each other
(case-insensitive), preserve the existing bio.tools ID.
If they do not contain each other, log a conflict but continue.
If the GitHub repo name is not already used as a bio.tools ID, use it as the new bio.tools ID.
If the GitHub repo name is already used as a bio.tools ID, attempt to generate a unique ID by appending suffixes
-1,-2, … up to-99. If a unique ID is found, use it.If no unique ID can be generated, log a note and return
None, requiring manual intervention.
- Parameters:
gh_name (str | None) – GitHub repository name.
bt_id (str | None) – Existing bio.tools ID.
- Returns:
Mapped bio.tools ID, or
Noneif mapping failed.- Return type:
str | None