Skip to main content

Python chess engine

Project description

Chessidle

Chessidle is a Python chess engine that can analyze standard and chess960 (Fischer random) chess positions.

Installation

Requires Python 3.9+

Download the latest release from pypi:

pip install chessidle

or download the most recent development version from source:

git clone https://github.com/alvinypeng/chessidle
cd chessidle
pip install .

Usage

Run UCI

chessidle

Run as a module if running as a script does not work:

python -m chessidle

Use with python-chess

It is possible to use Chessidle with python-chess. Here is a small example script to play against Chessidle in the terminal.

import chess
import chess.engine

board = chess.Board()
engine = chess.engine.SimpleEngine.popen_uci('chessidle')

while not board.is_game_over():
    print(board, '\n')

    s = input('Your move:') if board.turn else engine.play(board, chess.engine.Limit(time=3)).move.uci()
    
    for push in (board.push_uci, board.push_san):
        try:
            push(s)
            print(s, 'played \n')
            break
        except ValueError:
            pass
    else:
        print('Invalid move \n')

print(board, '\n\n', 'Game is over')
engine.quit()

Supported UCI commands

Options

Hash Threads MultiPV UCI_Chess960 MoveOverhead

Go

wtime btime winc binc movestogo depth nodes movetime

Acknowledgements

Neural networks for this project are trained on data generated by Leela Chess Zero.

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

chessidle-1.3.0.tar.gz (15.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chessidle-1.3.0-py3-none-any.whl (16.0 MB view details)

Uploaded Python 3

File details

Details for the file chessidle-1.3.0.tar.gz.

File metadata

  • Download URL: chessidle-1.3.0.tar.gz
  • Upload date:
  • Size: 15.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for chessidle-1.3.0.tar.gz
Algorithm Hash digest
SHA256 df3b22222529e83ec7dfa195db37eb1c14b0d45ff0ad8e8a118242781172b991
MD5 642e4a655801310ddb8d9b772f2515bd
BLAKE2b-256 c97cc6dcc2decd280e0e2fa31de497a64f16b7ab088f46b4ab0177c5d8297095

See more details on using hashes here.

File details

Details for the file chessidle-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: chessidle-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 16.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for chessidle-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b66cfc4e4e6bd48783ad52bc9465dddacbd822f0da261209ccc63d030b49533
MD5 4b0975c3959b477d08b5da046ed14c64
BLAKE2b-256 a446bc3afae40810bb0414ce103ece0914aa72ff411c95d68cb1bc9b42207659

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page