bridge.pipelines.gh2bt_for_meta.map_funcs.description module

bridge.pipelines.gh2bt_for_meta.map_funcs.description module#

Mapping functions for description metadata.

This module reconciles textual tool descriptions between GitHub and bio.tools. GitHub descriptions are treated as authoritative when present. If GitHub provides no description and bio.tools is empty, a short description is generated from the README using an LLM.

async bridge.pipelines.gh2bt_for_meta.map_funcs.description.map_description(gh_params, bt_description)[source]#

Map and reconcile GitHub description metadata and bio.tools description metadata.

Policy: 1. If GitHub provides no metadata, the existing bio.tools description

is preserved.

  1. If GitHub provides a description: - If it is effectively identical to the bio.tools description

    (ignoring trailing punctuation and whitespace), no change is made.

    • Otherwise, the GitHub description overwrites the bio.tools value.

  2. If GitHub provides no description and bio.tools is empty: - If a README is available, a short description is generated from

    the README using an LLM and normalized before storage.

    • If no README is available, no description is set.

  3. LLM failures never overwrite existing bio.tools descriptions.

Parameters:
  • gh_params (dict | None) – GitHub metadata dictionary. Expected keys include: - "description" : Repository description string (optional) - "readme" : README contents used for LLM-based description generation

  • bt_description (str | None) – Existing bio.tools description, or None if unset.

Returns:

The reconciled bio.tools description, or None if no description could be determined.

Return type:

str | None