r/ComputerChess • u/Markjleonard • Sep 06 '26
chess-results: turn a chess-results.com tournament into a TRF file bbpPairings/JaVaFo can pair from
I wanted to feed a live tournament on chess-results.com into a free pairing engine, and the obvious approach — scrape the current round's page — gives you wrong scores. The site deletes a round's "bye" and "not paired" rows the moment the next round is paired, so anything reading only the round pages scores those players a point light. bbpPairings recomputes every score from the games you give it and refuses the file outright if the total disagrees, so this isn't cosmetic — it's the difference between a file that pairs and one that doesn't.
chess-results is a Python library and CLI that fixes this by also reading the tournament's crosstable (art=5), which keeps the full record even after a round page has had rows deleted, and reconciling the two views. From there it can give you:
- a per-player round-by-round history (opponent, colour, float, result)
- standings, a printable pairing sheet, or JSON
a FIDE TRF export, so bbpPairings or JaVaFo can read a tournament straight out of chess-results.com and pair the next round
pip install chess-results
$ chess-results standings 1452107 --after 6 2026 British Chess Championships: Championship — after round 6 1 5 2 GM Adams, Michael 2 5 3 GM Royal, Shreyas 3 5 4 IM Grieve, Harry ...
One motivating case: Swiss-Manager uploads to chess-results.com after every round, so if the machine running it dies mid-event, the tournament state already lives on the public site — this can pick it back up and hand it to a free, cross-platform engine for the next round's pairings, no licence or Windows box required.
A few things worth knowing upfront:
- Free, MIT licensed — no ads, accounts, or anything to buy.
- Standard Swiss only — round robins and team events are detected and refused rather than half-read, since their pages don't parse into anything meaningful.
- Gentle on chess-results.com — one request per second, aggressive caching, an identifying user-agent.
- 331 offline tests across seven real tournaments from six federations, with scores cross-checked against each tournament's own published totals. Early days — bug reports against real tournaments very welcome, especially if your event's column layout doesn't match what's been tested.
- Compares to chessResults (R) roughly how a corrected, per-player history compares to the site's tables as-published — that one doesn't attempt the bye/crosstable reconciliation.
Code and docs: https://github.com/markjonleonard/chess-results