5

I am working on a research project where we need to run stockfish on hundreds of thousands of pgns we have collected. We need to extract all information generated from stockfish like centipawns, inaccuracies, blunders, mistakes, etc. I know you can download stockfish .exe and some gui to use it with. But we need to run it on large number of existing pgns in an automated manner preferably using python.

Elias
  • 51
  • 2
  • 1
    Stockfish itself is a command line program so I suspect it should be possible to call it from within a python program. – koedem Jan 25 '23 at 09:24
  • 1
    Pleaes note that blunders, mistakes and so on are not engine output but rather definitions made on top to (at least in theory) make analysis more human-readable – David Jan 25 '23 at 14:44
  • Related: [Is there a way to get blunders, mistakes and inaccuracies using Stockfish?](https://chess.stackexchange.com/q/41396/26335) – SecretAgentMan Jan 25 '23 at 15:19

2 Answers2

4

Download Stockfish form official website. Note that there are different versions for different cpus - pick first one that works.

Then you can communicate with stockfish using UCI protocol. For python library python-chess supports it.

For distributed analysis Lichess developed Fishnet which is open source. Maybe you can adapt it for your needs?

Matija Sirk
  • 801
  • 2
  • 11
1

Nibbler appears to have partial Stockfish support; it's Leela-oriented.

I've requested for Lichess to make their feature available locally - it helps if they hear from more users, consider commenting. Since it's open-source, locality is of course possible for an outsider to implement, if willing.