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.4.tar.gz
(41.0 kB
view details)
Built Distribution
File details
Details for the file chess_coverage-0.1.4.tar.gz
.
File metadata
- Download URL: chess_coverage-0.1.4.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 | ed7152ba02d80882223c215e55b58fb2c8a95c53cc953414d1808473b62d40c8 |
|
MD5 | 72eebf265e1af7258dcf7ef1d006e1ff |
|
BLAKE2b-256 | 5026804583f5c7f9db14c3ee9a8d1eed463d9593a59e51ffe1f9de3b2018f926 |
File details
Details for the file chess_coverage-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: chess_coverage-0.1.4-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 | 0d351f04d6176e2aab2886a75570d055f0ade24e7869db51afe2acc56c88afca |
|
MD5 | 92dcb6eef9686bfa31ac83fb22abaf7c |
|
BLAKE2b-256 | 2900ed925fd0154af6ce6e896d8de9b61e2ce816531797280a43a9d7392858f1 |