python-chessx
A chess XAI program
1. Introduction
python-chessx is an explainable chess AI that generates commentary for positions/moves in a game of chess.
2. Dependencies
- Python3 - Download and Install Python3. You can also use your system's package manager to install the latest stable version of python3.
- For dev work, run the following commands (preferrably in a virtual environment):
pip install -e .
3. Features
- Provides a utility to generate explanations from a FEN representation of a chess position.
- Piece Square Tables
import chessx.heuristic as heuristic import chess psqt_fen = 'rn2kb1r/pp2qppp/2p2n2/4p1B1/2B1P3/1QN5/PPP2PPP/R3K2R b KQkq - 1 9' psqt_util=heuristic.PSQT(psqt_fen) # generate list of explanations exp_list=psqt_util.get_explanations() # print explanations print('PSQT Explanations:') for exp in exp_list: print(exp)
- Trapped Pieces
tp_fen='r5k1/p4p1p/2p3pb/2N1n2n/1p2PP2/1B2B1PP/PP4K1/3R4 b - - 0 24' tp_util=heuristic.TrappedPieces(tp_fen) # generate list of explanations exp_list=tp_util.get_explanations() # print explanations print('Trapped Pieces Explanations:') for exp in exp_list: print(exp)
- Pinned Pieces
pin_fen='1rk5/8/4n3/5B2/1N6/8/8/1Q1K4 b - - 0 1' pin_util=heuristic.PinnedPieces(pin_fen) # generate list of explanations exp_list = pin_util.get_explanations() # print explanations print('PinnedPieces Explanations:') for ex in exp_list: print(ex) print()
3. Tests
The following command to runs unit tests on the project:
pytest
Metadata
Release files for chessx 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chessx-0.2.0.tar.gz | 13.2 kB | Without provenance | Details for chessx-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chessx-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for chessx-0.2.0-py3-none-any.whl |
Total release size: 25.8 kB
Release files / chessx-0.2.0.tar.gz
| Download URL | chessx-0.2.0.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc0d1b0c20595fc0b3cc2d0fd87935fb0f89559bc564d13e5278361f99444edd
|
|
BLAKE2b-256 checksum How to use checksums |
c88a97b4f411fd71d20778b1c78716f4f224af77363ee41b5a5f4f926c084ea9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / chessx-0.2.0-py3-none-any.whl
| Download URL | chessx-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d37cf6ee85970eaefa1e7e4f34b8556fd7214252b0861efd80b64e6610b3088f
|
|
BLAKE2b-256 checksum How to use checksums |
f6bbd2d79175d3f9c61b35310cb3fd2ed3a5c19ef65c75465be44747cb2b35e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for chessx 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.