Skip to main content

Wraps the open-source Stockfish chess engine for easy integration into python.

Project description

This integrates the Stockfish chess engine with python. It allows the engine to be used

by invoking an easy-to-use Engine class with synchronization handled automatically.

>>> from pystockfish import *
>>> deep = Engine(depth=20)
>>> deep.setposition(['e2e4'])
>>> deep.bestmove()
{'info': 'info depth 10 seldepth 13 score cp -40
nodes 33303 nps 951514 time 35 multipv 1 pv b8c6 g1f3 g8f6
b1c3 e7e5 f1b5 f8d6 e1g1 e8g8 d2d4 e5d4 f3d4 a7a6',
'ponder': 'g1f3',
'move': 'b8c6'}
>>> deep.setposition(['e2e4','e7e5'])
>>> deep.bestmove()
{'info': 'info depth 10 seldepth 2 score cp 40
nodes 4230 nps 1057500 time 4 multipv 1 pv g1f3 g8f6
b1c3 b8c6 f1b5 f8d6 e1g1 e8g8 d2d4 e5d4 f3d4 a7a6',
'ponder': 'g8f6',
'move': 'g1f3'}

The package also implements a Match class to play chess two engines against one another.

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

pystockfish-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pystockfish-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pystockfish-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a4fe1741d4d3bcf55920179c7ee5f80fe97c97a460e5687b5b5099d952d1d3a4
MD5 55c21a75384753631b6133177ff7167f
BLAKE2b-256 364c6c43e98bde6d2a253b1f7615a95f8f1042181d0993aaf9c1a6c713bae971

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