Expose the potential energy of chess ply
Project description
python-chess-coverage
Expose the potential energy of chess ply
This library constructs a dictionary of chess piece threat and protection statuses, keyed by "rank and file" board positions.
Usage:
import chess
import json
from chess_coverage import Coverage
board = chess.Board()
board.push_san("e4")
board.push_san("d5")
c = Coverage(board)
cover = c.cover()
print(json.dumps(cover, indent=2, sort_keys=True))
Example result fragment:
"e4": {
"color": true,
"index": 28,
"is_protected_by": [],
"is_threatened_by": ["d5"],
"moves": ["d5", "e5"],
"occupant": "white pawn",
"position": "e4",
"protects": [],
"symbol": "P",
"threatens": ["d5"],
"black_can_move_here": [],
"white_can_move_here": [],
"black_can_capture_here": [],
"white_can_capture_here": []
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
chess_coverage-0.1.8.tar.gz
(41.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chess_coverage-0.1.8.tar.gz.
File metadata
- Download URL: chess_coverage-0.1.8.tar.gz
- Upload date:
- Size: 41.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bf35038b75a6c8b53805804e8b48d13480cdacd960b52c6b47fa7ee9c66b106
|
|
| MD5 |
fa48ad741907f938319cd6d56fc74ce7
|
|
| BLAKE2b-256 |
9a3f2698ae37e958633545c5a4e5508b39da2305fd7a30cc47ab356b4f800ee6
|
File details
Details for the file chess_coverage-0.1.8-py3-none-any.whl.
File metadata
- Download URL: chess_coverage-0.1.8-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56c6d82a79c393c97337ed6b68846b4f0b8b6e21bd16fa1ddf5b4fa9fc8ed4b7
|
|
| MD5 |
92c91889fb89c6e60100468848182e65
|
|
| BLAKE2b-256 |
9c4321238dc769634a74cbf1fd72ca3fc187a66bb313ec0bdccfb56a2868a83e
|