Eric Wagoner 4e1211feb6 BGG API client: disk cache, rate limiting, 202-queue retry, XML parsing
httpx client with injectable clock/sleep/rng for testability. Successful
responses cached under data/bgg_cache/ keyed by endpoint+params; 202
retries follow the spec schedule (2/5/10/30s, give up after 5); 429/503
get jittered exponential backoff; consecutive requests are spaced
rate_limit_seconds apart. Parsers (via defusedxml, per security hook)
cover search, thing (+stats/+versions), and collection, including the
Not Ranked and error-document cases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-01 12:26:03 -04:00

bggpipe — Shelf-to-BoardGameGeek Collection Pipeline

Photograph your board game shelves. End up with your whole collection — including which edition of each game you own — cataloged on BoardGameGeek.

photos/ → [1 extract] → titles.json → [2 resolve] → matches.csv
        → [3 review] → matches.csv (approved) → [4 diff] → to_add.csv
        → [5 upload] → upload_log.csv
        → [6 enrich] → games.json

Status: pre-release. The design is complete (full spec); the code is being built. Nothing below works yet.

Why this exists

BGG has no bulk import and no write API. Cataloging a few hundred games by hand means hours of searching, clicking, and second-guessing which of five editions you own. This pipeline replaces that with: take photos, run a command, resolve a handful of ambiguous matches in a review step, done.

How it works

  1. extract — Shelf photos go to the Anthropic API (Claude vision), which reads game titles off spines and boxes along with edition cues: publisher, edition wording, print year, language.
  2. resolve — Titles are matched to BGG game IDs via the XML API2 (exact + fuzzy matching, popularity tiebreaks), then edition cues are matched against BGG's version list for each game. Anything uncertain is flagged rather than guessed.
  3. review — A local review step for ambiguous matches: pick the right game/version, or leave the version blank. Wrong guesses never reach your collection.
  4. diff — Your existing BGG collection is fetched and compared, per copy (owning one edition of a game doesn't hide a second edition you also own).
  5. upload — A Playwright browser session logs into your BGG account and adds each game — with its version, when known — politely and slowly, with dry-run mode, per-game logging, and resumability.
  6. enrich — Full metadata for every game (designers, player counts, weight, rank, mechanics, artwork URLs, version details) lands in data/games.json, ready to power whatever you build next.

Every stage is idempotent and resumable: kill it mid-run, restart, lose nothing. All artifacts are flat CSV/JSON files you can inspect and edit.

Requirements

  • macOS or Linux, Python 3.12+, uv
  • An Anthropic API key (vision extraction)
  • A BoardGameGeek account
  • Playwright Chromium: uv run playwright install chromium

Secrets come from environment variables only — ANTHROPIC_API_KEY, BGG_USERNAME, BGG_PASSWORD — and are never written to disk or logs.

A note on being a good BGG citizen

This tool is not affiliated with or supported by BoardGameGeek. It uses only the sanctioned XML API2 for reads and drives the regular website for writes, deliberately slowly (one request every couple of seconds, slower for uploads). Please keep it that way: BGG is a community resource running on community goodwill. You are responsible for your own account — review the dry-run output before a real upload.

License

MIT — see LICENSE.

S
Description
CLI and local browser pipeline for cataloging board game shelves into a BoardGameGeek collection: shelf photos → Claude vision title extraction → BGG XML API matching → human review → automated bulk upload.
Readme MIT 2.7 MiB
Languages
Python 84.9%
HTML 9.9%
CSS 4.5%
JavaScript 0.7%