Link Review Bats
Overview
Find bats that are not linked to any review and walk through interactive, suggested
connections that update associated_bat_ids after confirmation.
Quick Start
Run the interactive helper:
bash
python3 /Users/brianduryea/.codex/skills/link-review-bats/scripts/link_review_bats.py \ --repo ~/Coding_Projects/batdigest-flask
For non-interactive runs, use auto mode to apply high-confidence matches:
bash
python3 /Users/brianduryea/.codex/skills/link-review-bats/scripts/link_review_bats.py \ --repo ~/Coding_Projects/batdigest-flask \ --auto --auto-gap 0.5 --min-score 2.5
The script:
- •Loads
data/bats.yamland all review summaries indata/reviews/summaries/. - •Finds bat ids not present in any
associated_bat_ids. - •Suggests likely review matches and prompts in the terminal to confirm.
- •Preserves the original
associated_bat_idsformatting (quoted/unquoted, delimiter). - •In
--automode, applies strong matches and skips ambiguous ones. - •Matches only when review year and brand match exactly (with small brand aliases like "Slugger" -> "Louisville Slugger").
- •Matches only within the same sport: Fastpitch stays with Fastpitch; BBCOR/USSSA/USA map to Baseball.
Options
- •
--dry-runpreview changes without writing. - •
--year,--brand,--modelfilter bats to a subset. - •
--limitstop after N bats. - •
--topnumber of suggestions shown (default 5). - •
--min-scorethreshold for a “strong” suggestion (default 2.5). - •
--autoapply high-confidence matches without prompting. - •
--auto-gapminimum score gap between the top and runner-up for auto mode (default 0.5). - •
--auto-min-scoreoverride the score threshold used by auto mode.
Notes
- •The script appends new ids at the end and skips duplicates.
- •If the
pyyamlimport fails, install it withpython3 -m pip install pyyaml.