Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Simple python Stockfish wrapper

Project Description

Python Stockfish UCI Chess Engine wrapper


Getting Started:

pip install stockfishpy
  • Python 2.7
  • Download and make ‘Stockfish’ executable
  • Setup stockfish PATH in stockfishpy.py

USAGE:

Python console Example

>>> from stockfishpy.stockfishpy import *
>>> chessEngine = Engine(STOCKFISH_PATH, param={'Threads': 2, 'Ponder': 'true'})
>>> print chessEngine.uci()
uciok

>>> print chessEngine.isready()
readyok

>>> chessEngine.ucinewgame()
>>> chessEngine.setposition('rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1')
>>> move = chessEngine.bestmove()
>>> print move['bestmove']
e7e5

>>> print move['ponder']
g1f3

>>> print move['info']
info depth 12 seldepth 16 multipv 1 score cp -32 nodes 296597 nps 2879582 tbhits 0 time 103 pv e7e5 g1f3 b8c6 f1b5 g8f6 d2d3 f8c5 e1g1 e8g8 b5c6 d7c6 f3e5 d8e7


>>> chessEngine.ucinewgame()
>>> chessEngine.setposition(['e2e4', 'e7e5', 'g1f3'])
>>> move = chessEngine.bestmove()
>>> print move['bestmove']
b8c6

Tests:

  • Setup stockfish PATH in stockfishpy.py
  • Execute stockfishtest.py

License:

This project is licensed under the GPLv3 see the LICENSE file for details

Release History

Release History

This version
History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1.0.0

History Node

0.1.dev6

History Node

0.1.dev5

History Node

0.1.dev4

History Node

0.1.dev3

History Node

0.1.dev2

History Node

0.1.dev1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
stockfishpy-1.0.4.zip (8.7 kB) Copy SHA256 Checksum SHA256 Source Jan 17, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting