Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chess_coverage-0.1.8-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

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

Hashes for chess_coverage-0.1.8.tar.gz
Algorithm Hash digest
SHA256 7bf35038b75a6c8b53805804e8b48d13480cdacd960b52c6b47fa7ee9c66b106
MD5 fa48ad741907f938319cd6d56fc74ce7
BLAKE2b-256 9a3f2698ae37e958633545c5a4e5508b39da2305fd7a30cc47ab356b4f800ee6

See more details on using hashes here.

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

Hashes for chess_coverage-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 56c6d82a79c393c97337ed6b68846b4f0b8b6e21bd16fa1ddf5b4fa9fc8ed4b7
MD5 92c91889fb89c6e60100468848182e65
BLAKE2b-256 9c4321238dc769634a74cbf1fd72ca3fc187a66bb313ec0bdccfb56a2868a83e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page