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.2.tar.gz
(41.0 kB
view details)
Built Distribution
File details
Details for the file chess_coverage-0.1.2.tar.gz
.
File metadata
- Download URL: chess_coverage-0.1.2.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 | dc5ada7ec44d2162cbb06306ef15bdc8e98d25a59db1fc6a55033ce8c62eb5a0 |
|
MD5 | 818ad94ff9990a61a18a7ae97c12374d |
|
BLAKE2b-256 | a02cc1f39692138de06553d2bdda58bcef60b6cd9ab13a7e03daa4d7aeb471bc |
File details
Details for the file chess_coverage-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: chess_coverage-0.1.2-py3-none-any.whl
- Upload date:
- Size: 28.5 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 | 0511d2dc37b8832eca54850c4ae7294c346ac4938d609979f5f463b6492ee9b6 |
|
MD5 | 2cc4e721c82d75b06bb583f603760353 |
|
BLAKE2b-256 | 5687db641230b34abf300ebb89b6718cf539d2978b6ce3b00cffeaf9fa975055 |