bridge.pipelines.gh2bt_for_meta.map_funcs.homepage module#
Map homepage metadata from GitHub to bio.tools.
This module reconciles homepage URLs between GitHub repository metadata and existing bio.tools metadata. It applies a merge policy that prefers explicit GitHub homepage configuration when available, preserves existing bio.tools values when GitHub is silent, and falls back to the repository URL when no homepage is defined anywhere.
- bridge.pipelines.gh2bt_for_meta.map_funcs.homepage.map_homepage(gh_schema, bt_homepage)[source]#
Map and reconcile GitHub and bio.tools homepage URLs using the generic GitHub-over-bio.tools policy with URL canonicalization.
Homepage comparison is performed on canonicalized URLs. If neither GitHub nor bio.tools defines a homepage, the GitHub repository URL (
gh_schema["html_url"]) is used as a fallback.- Parameters:
gh_schema (dict[str, AnyUrl | str | None]) – GitHub repository metadata dictionary. Expected keys include: - ‘homepage’ : The homepage URL configured on GitHub (may be None). - ‘html_url’ : The GitHub repository URL (used as fallback).
bt_homepage (UrlftpType | None) – Existing homepage value from bio.tools metadata, or
Noneif none is defined.
- Returns:
The resolved homepage as a UrlftpType instance, or
Noneif no homepage could be determined (only possible if gh_schema is malformed).- Return type:
UrlftpType | None