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.1.tar.gz
(41.0 kB
view details)
Built Distribution
File details
Details for the file chess_coverage-0.1.1.tar.gz
.
File metadata
- Download URL: chess_coverage-0.1.1.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 | 6aa8ef530815ec9f07271320ce02f758394979309786ab78411d82475e05cd87 |
|
MD5 | 7208e0ce31042fb82774acf7fd4e1914 |
|
BLAKE2b-256 | f89295145b0556e6507381a2cb3474a13a06b491020223cfbbd78f1af9140bcb |
File details
Details for the file chess_coverage-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: chess_coverage-0.1.1-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 | ac8805b12d888054ee025c07c0b126fdf0a3d356b3755d3e0fd8140782f7fb83 |
|
MD5 | 9c656b5eae860ab9056510bd703cc1ba |
|
BLAKE2b-256 | 43c11ef57c68453f22b8f9317a4cde92d94828eee77805c63eafc5f7e96912e0 |