A wrapper for chess engines supporting the UCI protocol
Project description
chessEngines
This project is a wrapper for chess engines supporting the UCI protocol. It allows you to create a connection to a compiled chess engine and communicate with it. By default, the following engines are distributed with this project:
- Stockfish
- Leela Chess Zero
These distributions can be found under /Engines. The distributions are original and no changes have been made.
Usage
In the following we will connect to the default distribution of Stockfish and find the best move in a set position:
from chess_engines import engines
# called each time stockfish finds a potential 'best move'
def on_move_found(move):
print(move)
# load Stockfish
sf = engines.Stockfish()
# set starting position
sf.play_moves_san('1. e4 e5 2. Nf3 Nc6 3. Bc4')
# find the best move within 2 seconds
best_move = sf.best_move_san(max_secs=2, callback=on_move_found)
print(f'Best move: {best_move}')
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chessEngines-1.0.0.tar.gz
(13.0 kB
view hashes)
Built Distribution
Close
Hashes for chessEngines-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72738fe935bbaa5f3524d7adb806f9e468d8301e065ed7b0eeb9b6c3fccda4b3 |
|
MD5 | 34a4a19066fb82a239e1ac6bfce4ce81 |
|
BLAKE2b-256 | 6b20103bc786f7be5b83b9266d5cc8f886d3cdfdbb16b9a1590a2a84587440e6 |