bridge.pipelines.gh2bt_for_meta.map_funcs.license module

Contents

bridge.pipelines.gh2bt_for_meta.map_funcs.license module#

Map license metadata from GitHub to bio.tools.

This module reconciles license information between GitHub repository metadata and existing bio.tools metadata. It compares the license reported by GitHub with the license recorded in bio.tools, and applies a policy that prefers recognized GitHub licenses while preserving bio.tools values when GitHub is silent or ambiguous.

bridge.pipelines.gh2bt_for_meta.map_funcs.license.map_license(gh_license, bt_license)[source]#

Map and reconcile GitHub and bio.tools license annotations using the generic GitHub-over-bio.tools policy.

  • If GitHub provides a license but it is not recognized as a valid SPDX ID, and there is no existing

bio.tools license to fall back on, this function will log a note and return License.Other. - If GitHub provides no license and there is no existing bio.tools license, this function will return License.Not_licensed.

Parameters:
  • gh_license (str | None) – Github repository license (SPDX ID), or None if no license is configured.

  • bt_license (License | None) – Existing bio.tools license annotation, or None if no license is currently recorded.

Returns:

The reconciled license as a License enum member, or None if neither GitHub nor bio.tools provides a usable license.

Return type:

License | None