Skip to main content

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

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.1.tar.gz (64.6 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.1-py3-none-any.whl (55.6 kB view details)

Uploaded Python 3

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

Hashes for chess_pressure-0.1.1.tar.gz
Algorithm Hash digest
SHA256 944f37cf90fb591cb720f6bc07add1e6740231f25c49048f8965acc66cf729c3
MD5 db67ce981112df04d331872d62ff7d42
BLAKE2b-256 df7688be603d75d1b55b580ed02dae155338c508efe1e8dc08ece060993290de

See more details on using hashes here.

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

Hashes for chess_pressure-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a62dd71feedfc41ff29930a75a093b378371f1685dfa0385d828f1da47b7bde5
MD5 7c99ae52ece4f09823bc868b3b6b0772
BLAKE2b-256 62b24055478f1bddae30066fbad994cd514f2695f3874259ab932896992da195

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

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