py-draughts¶
The fastest pure-Python draughts / checkers library — bitboard move generation ~200× faster than pydraughts. Built-in alpha-beta engine, HUB protocol bridge (Scan, Kingsrow), web UI, SVG rendering, and ML/RL helpers across 8 variants: International, American, Frisian, Russian, Brazilian, Antidraughts, Breakthrough, and Frysk!.
Spin up a board, push moves, query legal moves, parse PDN/FEN. The 5-minute path to a working game.
Built-in alpha-beta engine, Hub protocol bridge, and a clean
Engine interface for plugging in your own.
Tensor representations, legal-move masks, MCTS skeleton, and a complete REINFORCE self-play example.
Drop-in FastAPI server with a polished UI for play, analysis, and engine matches.
Render boards and pieces with arrows, highlights, and full Jupyter notebook integration.
Performance numbers for legal-move generation and engine search, plus the tooling used to produce them.
Side-by-side comparison: speed, variants, engine, web UI, ML support. Why py-draughts is ~200× faster.
Installation¶
pip install py-draughts
uv add py-draughts
poetry add py-draughts
Hello, draughts¶
from draughts import Board, AlphaBetaEngine
board = Board() # 10x10 international draughts
board.push_uci("31-27")
board.push_uci("18-22")
engine = AlphaBetaEngine(depth_limit=5)
board.push(engine.get_best_move(board))
print(board)
Variants¶
Class |
Size |
Flying kings |
Notes |
|---|---|---|---|
|
10×10 |
Yes |
International draughts / FMJD (alias: |
|
8×8 |
No |
English checkers |
|
10×10 |
Yes |
Diagonal + orthogonal captures |
|
8×8 |
Yes |
Mid-capture promotion |
|
8×8 |
Yes |
International rules on 8×8 |
|
10×10 |
Yes |
Lose all pieces (or get blocked) to win |
|
10×10 |
Yes |
First player to make a king wins |
|
10×10 |
Yes |
Frisian rules with 5 men per side |