bridge.pipelines.bt2gh_for_pr_issues.map_funcs.readme module#
Map bio.tools metadata onto a GitHub README and inject badges.
This module takes an existing README.md (if any) and bio.tools metadata for a tool and produces an updated README that:
preserves an existing project title when possible,
preserves existing badges,
adds “bridge” and “bio.tools” badges,
adds a “tool type” badge based on bio.tools metadata (if available),
keeps the rest of the README content intact (below the title and badges).
- bridge.pipelines.bt2gh_for_pr_issues.map_funcs.readme.map_readme(gh_readme, bt_params)[source]#
Map bio.tools metadata onto a GitHub README and return updated content.
Steps performed: 1. Validates and interprets the required fields are present in bt_params. 2. Calls _build_readme to construct a new README that includes:
an existing title (if any), or a new one based on bt_params[‘name’],
merged badges (new bridge/bio.tools/tool type + existing badges),
the remaining original README content.
Returns the updated README under the key “README.md”.
- Parameters:
gh_readme (str | None) – The current README content from GitHub, or
Noneif the file does not exist yet.bt_params (dict[str, Any]) – The bio.tools tool metadata as a dictionary. Expected fields: - ‘name’ : Name of the tool. - ‘biotoolsID’ : bio.tools identifier of the tool. - ‘toolType’ : Optional list of tool types (typically ToolTypeEnum).
- Returns:
A dictionary with the filename “README.md” as key, and the updated README content as value.
- Return type:
dict[str, str]
- Raises:
ValueError – If required fields are missing from bt_params.