Skip to main content

A basic chess model to imports/export FEN & finds moves.

Project description

Chessnut is a simple chess board model written in Python. Chessnut is not a chess engine – it has no AI to play games, and it has no GUI. It is a simple package that can import/export games in Forsyth-Edwards Notation (FEN), generate a list of legal moves for the current board position, intelligently validate & apply moves (including en passant, castling, etc.), and keep track of the game with a history of both moves and corresponding FEN representation.

Chessnut is not written for speed, it is written for simplicity (there are only two real classes, and only about 200 lines of code). By adding a custom move evaluation function, Chessnut could be used as a chess engine. The simplicity of the model lends itself well to studying the construction of a chess engine without worrying about implementing a chess model, or to easily find the set of legal moves for either player on a particular chess board for use in conjunction with another chess application.

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

chessnut-0.4.1.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

Chessnut-0.4.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file chessnut-0.4.1.tar.gz.

File metadata

  • Download URL: chessnut-0.4.1.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for chessnut-0.4.1.tar.gz
Algorithm Hash digest
SHA256 033fd120eca1b0ebb0b48236df95d3e30e791cf52c4c7cd7f29a71b6a0dd7c85
MD5 02319383178cdbf340f553c231ae07b3
BLAKE2b-256 e554ff05eb5403373d28754d2f8175cfc88f669a6364f7fed67385ba1dcc9d62

See more details on using hashes here.

Provenance

The following attestation bundles were made for chessnut-0.4.1.tar.gz:

Publisher: python-publish-release.yml on cgearhart/Chessnut

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file Chessnut-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: Chessnut-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for Chessnut-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0c65f19e4e88a40a0372d646521754e44dd97be017e0814029ae42566bd3f7ea
MD5 fa1ed0784d5a638ac9823a588150aabb
BLAKE2b-256 4384c8078b302aba6225614a4893824b661fdaeb76514870fac2cf0767da0391

See more details on using hashes here.

Provenance

The following attestation bundles were made for Chessnut-0.4.1-py3-none-any.whl:

Publisher: python-publish-release.yml on cgearhart/Chessnut

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page