Skip to content
A python script that can annotate chess games in pgn file with static evaluation or search score of an engine, can annotate games with cerebellum book moves using the Brainfish engine with its Cerebellum_Light.bin book file, can annotate an epd file with acd, acs, bm, and ce opcodes and can test engine with epd test suite.
Branch: master
Clone or download
fsmosca Add comment on king safety
* When a move increases the king attack, add move comment "with a dangerous king attack"
*Refactor AnnotatePgn()

close #36
Latest commit 93fbd73 Apr 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE Initial commit Oct 6, 2016
README.md Update README.md Apr 15, 2019
README.txt
analyzed_sample.pgn Added analyzed_sample.pgn file Oct 27, 2018
chess-artist.py Add comment on king safety Apr 16, 2019
repertoire.epd Add files via upload Apr 10, 2019
sample.pgn Added sample.pgn file Oct 27, 2018
wacnew.epd Upload wacnew.epd Apr 8, 2019

README.md

Chess Artist

A python script that can analyze games in the pgn file. It can also analyze epd file, and can also test the engine using epd test suites. Only Python 2 is so far supported.

Requirements

Command lines

Analyze games in pgn file

Basic command line

python chess-artist.py --infile sample.pgn --outfile out_sample.pgn --enginefile Stockfish.exe --eval search --job analyze --movetime 2000

Add options to engine, use --engineoptions

python chess-artist.py --infile sample.pgn --outfile out_sample.pgn --enginefile Stockfish.exe --engineoptions "Hash value 128, Threads value 1" --eval search --job analyze --movetime 2000

Will analyze games inside sample.pgn and output the analyzed games in out_sample.pgn. It uses engine Stockfish.exe with Hash 128MB and Threads 1 at 2000 millisec or 2 sec analysis time per position. chess-artist.py and Stockfish.exe engine must be in same directory.

Analyze game with polyglot book

python chess-artist.py --infile sample.pgn --outfile out_sample.pgn --enginefile Stockfish.exe --engineoptions "Hash value 128, Threads value 1" --bookfile gm2600.bin --booktype polyglot --eval search --job analyze --movetime 2000

Test engine with test suite

python chess-artist.py --infile wacnew.epd --outfile result_wacnew.txt --enginefile stockfish_10.exe --engineoptions "Hash value 128, Threads value 1" --eval search --job test --movetime 500

Output file result_wacnew.txt

:: EPD wacnew.epd TEST RESULTS ::
Engine        : Stockfish 10 64 POPCNT
Time/pos (sec): 5.0

Total epd lines       : 300
Total tested positions: 300
Total correct         : 292
Correct percentage    : 97.33

:: EPD wacnew.epd TEST RESULTS ::
Engine        : Stockfish 10 64 POPCNT
Time/pos (sec): 0.5

Total epd lines       : 300
Total tested positions: 300
Total correct         : 274
Correct percentage    : 91.33

Annotate the epd file

Use Stockfish to annotate epd file at movetime 30s or 30000ms

python2 chess-artist.py --infile repertoire.epd --outfile out_repertoire.epd --enginefile stockfish_10.exe --engineoptions "Hash value 128, Threads value 1" --eval search --job analyze --movetime 30000

Example output:

rn1q1rk1/pbp2ppp/1p1ppn2/6B1/2PP4/P1Q1P3/1P3PPP/R3KBNR w KQ - c0 "Nimzo-Indian"; acd 26; acs 30; bm f3; ce +46; Ae "Stockfish 10 64 POPCNT";
rnbq1rk1/pp2ppbp/6p1/2p5/3PP3/2P2N2/P4PPP/1RBQKB1R w K - c0 "Gruenfeld"; acd 26; acs 30; bm Be2; ce +74; Ae "Stockfish 10 64 POPCNT";

Credits

You can’t perform that action at this time.