Skip to main content

A python chessboard library for representing game positions.

Project description

chess-board

What is chess-board?

chess-board is a Python chessboard package with a flexible "just a board" API for graphically representing game positions.

What chess-board is not

  • A chess engine
  • A legal move validator
  • A PGN parser

While chess-board is designed to work well with any of these, the idea behind chess-board is that the logic that controls the board should be independent of those other problems.

Usage

test.py - example

from chessboard import display

position = 'rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2'

while True:
    display.start(position)

Entry Points

from chessboard import display

validfen = 'rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2'

# Initialization
display.start()

# Position change/update
display.update(validfen)

# Checking GUI window for QUIT event. (Esc or GUI CANCEL)
display.checkForQuit()

# Close window
display.terminate()

Installation

Download and install the latest release:

# install into virtualenv
pip install chess-board

or 

# install with pipenv
pipenv install chess-board

or

# install system-wide (not adviced)
sudo pip install chess-board

Alternatively, you could git clone this repo and add the directory to your package.

git clone https://github.com/ahira-justice/chess-board.git

Dependencies

pygame

chess-board installation automatically installs latest pygame version.

License

GNU GENERAL PUBLIC LICENSE

Project details


Download files

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

Files for chess-board, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size chess_board-0.2.0-py3-none-any.whl (37.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size chess-board-0.2.0.tar.gz (22.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page