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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chess_pressure-0.1.1.tar.gz.
File metadata
- Download URL: chess_pressure-0.1.1.tar.gz
- Upload date:
- Size: 64.6 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
944f37cf90fb591cb720f6bc07add1e6740231f25c49048f8965acc66cf729c3
|
|
| MD5 |
db67ce981112df04d331872d62ff7d42
|
|
| BLAKE2b-256 |
df7688be603d75d1b55b580ed02dae155338c508efe1e8dc08ece060993290de
|
File details
Details for the file chess_pressure-0.1.1-py3-none-any.whl.
File metadata
- Download URL: chess_pressure-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a62dd71feedfc41ff29930a75a093b378371f1685dfa0385d828f1da47b7bde5
|
|
| MD5 |
7c99ae52ece4f09823bc868b3b6b0772
|
|
| BLAKE2b-256 |
62b24055478f1bddae30066fbad994cd514f2695f3874259ab932896992da195
|