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.0.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.0.0-py3-none-any.whl (16.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chessidle-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 9c276c861a110a42c72623a980496407e9cbddd046c4ae357b5d9ad2f849b539
MD5 4f3036ed83845cbc2909ec072a581380
BLAKE2b-256 33870d227b2f0205990ea9d0bcbc6a65e4468216f3e7e011e0bb16aeee9b3586

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chessidle-1.0.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.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44e432f3e309e6a96e1104e7f0ff82afa251552dbc4107dea18f52f6ede38ded
MD5 dd1efdafb28b0c5f0916dd6ebeba7e75
BLAKE2b-256 b3c92abc00df3593fa34b541f67616fdcdcfea03a1cc37c01d0d240b004f25de

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