Skip to main content

A draughts library for Python with move generation and engine communication

Project description

pydraughts

PyPI version Tests Build CodeQL

pydraughts is a draughts library for Python with move generation and engine communication. It is based on ImparaAI/checkers.

Features

Note: White always starts. Black always has the squares starting from 1 (e.g. 1-20 in international draughts).

Variants:

  • Standard (International)
  • Frisian
  • frysk!
  • Antidraughts
  • Breakthrough
  • Russian
  • Brazilian
  • English/American
  • Italian

Engine protocols:

  • Hub
  • DXP
  • CheckerBoard

  • Import library
from draughts import Game, Move
  • Create a game
game = Game(variant="standard", fen="startpos")
  • Make a move
game.move([34, 30])
  • Get legal moves
moves, captures = game.legal_moves()
  • Convert move to other types
move = Move(game, board_move=moves[0]).pdn_move
  • Get fen
fen = game.get_li_fen()
  • Communicate with engines
from draughts.engine import HubEngine, Limit
engine = HubEngine("scan.exe hub")
enigne.hub()
engine.init()
limit = Limit(time=10)
engine_move = engine.play(game, limit, ponder=False)

Acknowledgements

Thanks to RoepStoep for his draughtsnet which was modified to add support for Hub engines. Thanks to akalverboer for their DXC100_draughts_client which was modified to add support for DXP engines.

License

pydraughts is licensed under the GPL 3 (or any later version at your option). Check out LICENSE.txt for the full text. The license of ImparaAI/checkers is also present here.

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

pydraughts-0.2.3.tar.gz (37.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydraughts-0.2.3-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file pydraughts-0.2.3.tar.gz.

File metadata

  • Download URL: pydraughts-0.2.3.tar.gz
  • Upload date:
  • Size: 37.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.2

File hashes

Hashes for pydraughts-0.2.3.tar.gz
Algorithm Hash digest
SHA256 9426958411056809dc241a52daae45c6695aa87b8cf9ae5196a206e4bffc9b4e
MD5 89ac6a1b97a4d9f6f21190595326e46c
BLAKE2b-256 585ed788ec5815b271267de54e3cfaebf162f6e6fa3375c1a7df71ad187ddd34

See more details on using hashes here.

File details

Details for the file pydraughts-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: pydraughts-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.2

File hashes

Hashes for pydraughts-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3266671c24f51700a93e7e9f2175048d4c929ce168d50aa0f1af825dec475bc7
MD5 e1e03925e7f2af10f0c91e61df6a344d
BLAKE2b-256 6eabc914d192ce54eb004399d3f67e4537e6623558d1797ff6906c1c69b06125

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