Skip to main content

Chess pressure heatmap visualization

Project description

Chess Pressure

A web application that visualizes pressure maps on a chess board -- showing which squares are controlled by white vs. black across every move of a game.

What is "pressure"?

For each square on the board, pressure is the net number of pieces attacking it. Positive values mean white controls the square; negative means black does. Two modes are available:

  • Unweighted -- each attacking piece contributes +1 or -1.
  • Weighted -- each attacking piece contributes its material value (pawn=1, knight/bishop=3, rook=5, queen=9, king=1).

Features

  • Step through famous built-in games move by move and watch the pressure heatmap evolve.
  • Upload your own PGN to analyze any game.
  • Make moves from any position and see legal moves + pressure updates in real time.
  • FastAPI backend with a lightweight static frontend.

Built-in Games

Game Year White Black
The Immortal Game 1851 Anderssen Kieseritzky
The Opera Game 1858 Morphy Duke of Brunswick & Count Isouard
Kasparov's Immortal 1999 Kasparov Topalov
Fischer vs Spassky, Game 6 1972 Fischer Spassky
Kasparov vs Deep Blue, Game 2 1997 Deep Blue Kasparov

Quickstart

# Install dependencies
pip install fastapi uvicorn python-chess

# Run the server
python -m chess_pressure.app

The app starts on http://localhost:8888.

API

Method Endpoint Description
GET /api/games List built-in games
GET /api/games/{id} Load a built-in game (headers, moves, pressure frames)
POST /api/parse Parse a PGN string ({"pgn": "..."})
GET /api/legal?fen=... Get legal moves for a FEN position
POST /api/move Make a move ({"fen": "...", "uci": "e2e4"})

Project Structure

chess_pressure/
  __init__.py
  app.py       # FastAPI routes and static file serving
  engine.py    # Pressure computation, PGN parsing, move logic
  games.py     # Built-in famous games (PGN data)

License

MIT

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_pressure-0.1.0.tar.gz (64.7 kB view details)

Uploaded Source

Built Distribution

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

chess_pressure-0.1.0-py3-none-any.whl (55.6 kB view details)

Uploaded Python 3

File details

Details for the file chess_pressure-0.1.0.tar.gz.

File metadata

  • Download URL: chess_pressure-0.1.0.tar.gz
  • Upload date:
  • Size: 64.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for chess_pressure-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f435ce148487a302596620ec6d1b3379fd70fe2885be502b73acd6b113d8aeec
MD5 6d9c404e13c044a16d21dc7f402f6d37
BLAKE2b-256 10cb5f5ee95e35ee9c1aad98ab18f93b4bef059b2945a3a028797576615cfc93

See more details on using hashes here.

File details

Details for the file chess_pressure-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chess_pressure-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 55.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.25 {"installer":{"name":"uv","version":"0.9.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for chess_pressure-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4228df2d29590846f0597ca126dd24878a2d66a3b4d0542b184ba3774d576d70
MD5 64981b0a35530e1021b1f11882aa2417
BLAKE2b-256 55439047fceb7325ee6cfabc54e910fe9ecd1af5cfbe176155bd8436b88bd4be

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