Skip to main content

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.

Entry Points

from chessboard import display

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

# Initialization
game_board = display.start()

# Position change/update
display.update(valid_fen, game_board)

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

# Close window
display.terminate()

Usage

test.py - example

from chessboard import display

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

game_board = display.start()

while True:
    display.check_for_quit()
    display.update(valid_fen, game_board)

    # board flip interface
    if not game_board.flipped:
        display.flip(game_board)

Installation

Download and install the latest release:

# install into virtualenv
source env/bin/activate
pip install chess-board

or 

# install with pipenv
pipenv install chess-board

or

# install system-wide
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==2.1.2

chess-board installation automatically installs latest pygame version.

License

GNU GENERAL PUBLIC LICENSE

Metadata

Release files for chess-board 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chess-board 0.4.1
File Size Uploaded
chess-board-0.4.1.tar.gz 37.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chess-board 0.4.1
File Interpreter ABI Platform
chess_board-0.4.1-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 75.0 kB

Release files / chess-board-0.4.1.tar.gz

Download URL chess-board-0.4.1.tar.gz
Size 37.3 kB
Tags Source
SHA-256 checksum
How to use checksums
19bbb147a5d8ea1d6657f265d76a22e576a83c5601b1c4030385e9eceeac65af
BLAKE2b-256 checksum
How to use checksums
859a8b1c6dbee4962547b76fa49cd6ef9d9f128c845714f265d6ad81c747d5f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release files / chess_board-0.4.1-py2.py3-none-any.whl

Download URL chess_board-0.4.1-py2.py3-none-any.whl
Size 37.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
11f92defe71acd041c6cdb5ed563e7e62f0839c49ab06a56d9acf70e0fe03e05
BLAKE2b-256 checksum
How to use checksums
e3688691d498c143da725010a51d4e8dea1fa80ad4937fe05fb0b92a6a7276d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page