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": []
  }

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.3.tar.gz (41.0 kB view details)

Uploaded Source

Built Distribution

chess_coverage-0.1.3-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

File details

Details for the file chess_coverage-0.1.3.tar.gz.

File metadata

  • Download URL: chess_coverage-0.1.3.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

Hashes for chess_coverage-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b86598390f592aef317b0a4bd0b5341acdad576ec63bdc102ac5b1a092960e53
MD5 77f99d368e5909f60c6f519912468534
BLAKE2b-256 1a5200fd5b1d6ecebe905c864ab9f838c25a26f60e5d6ba58fd7acf5f9fd9a1e

See more details on using hashes here.

File details

Details for the file chess_coverage-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for chess_coverage-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e74e8b495c7c0fb57d495cd8d1dbcca2d2937135dbadd212fa5a722f9fe9a44d
MD5 a13d4a445430193322afeceb3e7a7fcf
BLAKE2b-256 250bc2c9fb7e79c5fa4051856baeb2b20903e65fecca09878ad72aec4e71268b

See more details on using hashes here.

Supported by

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