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.tar.gz (3.3 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: stockfish-2.0.tar.gz
  • Upload date:
  • Size: 3.3 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.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.1

File hashes

Hashes for stockfish-2.0.tar.gz
Algorithm Hash digest
SHA256 18a00c71f18ffbaebf3800f79ab028b970f6cbba3a3ceca1137d48bc2f3549f9
MD5 0df6d98f89dc67836cb2ac8da2ba508b
BLAKE2b-256 51b25ad9c10c12eaa76ffbeafa68ba99f2dc6393c1d03064bb5d9d303aba9f01

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