I built a Python tool for scraping tournament data from chess-results.com

Discuss anything you like about chess related matters in this forum.
Post Reply
mleonard
Posts: 21
Joined: Mon Aug 10, 2009 8:41 pm

I built a Python tool for scraping tournament data from chess-results.com

Post by mleonard » Sat Aug 15, 2026 10:11 am

I wrote a small Python tool that hands you a tournament's data in a form you can work with: standings, or a full per-player history — who each player met, what colour, whether they floated or took a bye — as a command-line report, a printable pairing sheet, or JSON.

Code: Select all

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
   4    5    6  IM  Bazakutsa, Svyatoslav
   5   4½    7  IM  Harvey, Marcus R
   6   4½    9  IM  Czopor, Maciej
Swiss Manager uploads results to https://chess-results.com after every round — so if the laptop running it dies mid-event and nobody can lay hands on the licence, this tool can pick that data back up, hand it to a free pairing program, and produce the next round without it. I've tested that path with https://github.com/BieremaBoyzProgramming/bbpPairings (free to download), but anything similar should work.

A few honest caveats if you're leaning on it that way:
  • You need internet at the venue.
  • Standard Swiss only — no round robins or the more exotic formats.
  • It can only work from the last round Swiss Manager managed to upload. If the laptop died before those results went up, that round's gone with it.
  • Treat the output as a fair, legal pairing — not necessarily the exact one Swiss Manager would have made.
It's gentle on chess-results.com, however you use it: one second between requests, an identifying user-agent, and aggressive caching.

Code and docs: https://github.com/markjonleonard/chess-results

Questions and real-event bug reports very welcome — especially if your tournament's page doesn't match the layouts I've tested against.

Roger de Coverly
Posts: 22607
Joined: Tue Apr 15, 2008 2:51 pm

Re: I built a Python tool for scraping tournament data from chess-results.com

Post by Roger de Coverly » Sat Aug 15, 2026 1:11 pm

mleonard wrote:
Sat Aug 15, 2026 10:11 am
Swiss Manager uploads results to https://chess-results.com after every round — so if the laptop running it dies mid-event and nobody can lay hands on the licence, this tool can pick that data back up, hand it to a free pairing program, and produce the next round without it.
I think these days arbiters attend tournaments in packs, so multiple laptops are usually available. Swiss Manager has a feature that provided the results have been uploaded to the chess-results server and that is still running, any arbiter, anywhere can download the tournament data and both check the pairings for previous rounds and produce the next round.

I don't think Swiss Manager is very fault tolerant. Once a pairing has been "published" it can be had work to change it if an error is discovered in the results for previous rounds.

mleonard
Posts: 21
Joined: Mon Aug 10, 2009 8:41 pm

Re: I built a Python tool for scraping tournament data from chess-results.com

Post by mleonard » Sat Aug 15, 2026 1:17 pm

That's a fair point about arbiters usually travelling in packs -- certainly true at Frome Congress!
It's good to know that Swiss Manager can pull the tournament back down from chess-results itself if another copy is running.

My own angle on this is a bit different, though: I use a Mac, and Swiss Manager is Windows-only, so I don't run a copy of my own at all. I have to borrow someone else's machine.
This tool and a free cross-platform pairing engine is what lets me get from chess-results.com to a printable pairing sheet without needing a Windows machine of my own.

Paul McKeown
Posts: 3828
Joined: Thu Apr 12, 2007 3:01 pm
Location: Hayes (Middx)

Re: I built a Python tool for scraping tournament data from chess-results.com

Post by Paul McKeown » Sat Aug 15, 2026 1:38 pm

mleonard wrote:
Sat Aug 15, 2026 1:17 pm
I use a Mac, and Swiss Manager is Windows-only
Swiss Manager works perfectly well on Linux with Wine translation, in our experience at Richmond Juniors. I think you ought to be able to do something similar on Mac OS.
International Arbiter, FIDE Instructor
Richmond Junior Chess Club
Fulham Junior Chess Club
ECF Games Played Abroad Administrator

mleonard
Posts: 21
Joined: Mon Aug 10, 2009 8:41 pm

Re: I built a Python tool for scraping tournament data from chess-results.com

Post by mleonard » Sat Aug 15, 2026 3:01 pm

That's good to know, but my Mac is owned by my company and I'm not allowed to install Wine. I'd like to try it but some software installs are restricted.

Post Reply