Skip to main content

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

Project description

Stockfish

Build Status

Implements an easy-to-use Stockfish class to integrates the Stockfish chess engine with Python.

Install

$ pip install stockfish

Features

  • set current position
  • get best move

Usage

from stockfish import Stockfish

# you should install the stockfish engine in your operating system globally or specify path to binary file in class constructor
stockfish = Stockfish('/Users/zhelyabuzhsky/Work/stockfish/stockfish-9-64')

# set position by moves:
stockfish.set_position(['e2e4', 'e7e6'])

# set position by FEN:
stockfish.set_fen_position("rnbqkbnr/pppp1ppp/4p3/8/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2")

print(stockfish.get_best_move()) # d2d4
print(stockfish.is_move_correct('a2a3')) # True

Testing

$ python setup.py test

Security

If you discover any security related issues, please email zhelyabuzhsky@icloud.com instead of using the issue tracker.

Credits

License

GNU General Public License, version 3. Please see License File for more information.

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

stockfish-2.0.1.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file stockfish-2.0.1.tar.gz.

File metadata

  • Download URL: stockfish-2.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.7.1

File hashes

Hashes for stockfish-2.0.1.tar.gz
Algorithm Hash digest
SHA256 21f84fecea067be574ade900757c2a316862389ad244da9df2db20b0a74c41e9
MD5 c53706e04947fdbb17ea9518fdca5cd0
BLAKE2b-256 f30cb0f58c004e76ea83a798bf5714c6655fb888c972b4eea4cc8d59424ff1c7

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