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": []
}
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
chess_coverage-0.1.0.tar.gz
(41.0 kB
view details)
Built Distribution
File details
Details for the file chess_coverage-0.1.0.tar.gz
.
File metadata
- Download URL: chess_coverage-0.1.0.tar.gz
- Upload date:
- Size: 41.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8248d1aa651d41d4cfc66c3b612c5177685c749d78286db2d1bf8f2c589d03d0 |
|
MD5 | d814cd69a0b01f3609e368a3d1098351 |
|
BLAKE2b-256 | b2010f02cbda06feeb61c848de6dc8f533bf75ee8d232a5875ea000f49c09df4 |
File details
Details for the file chess_coverage-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: chess_coverage-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2c7560d0432b67a0d500fe74d6388d0d7e87ddd51fba3bb23b0bfe98403dfbc |
|
MD5 | e443bdc37db851298ae1150a7218ccca |
|
BLAKE2b-256 | f25358c30dd830944dfd9ea9eb8c138f4dd9d32969daf7a48a49e15048656c60 |