Compare commits

...

2 Commits

4 changed files with 13 additions and 9 deletions

View File

@ -22,18 +22,19 @@ For each square on the board, pressure is the net number of pieces attacking it.
|------|------|-------|-------|
| 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 |
| Shirov vs Polgar | 1994 | Shirov | Polgar |
| Kasparov vs Deep Blue, Game 2 | 1997 | Deep Blue | Kasparov |
| Kasparov's Immortal | 1999 | Kasparov | Topalov |
| Polgar vs Anand | 1999 | Polgar | Anand |
| Polgar vs Kasparov | 2002 | Polgar | Kasparov |
| Hou Yifan vs Caruana | 2017 | Hou Yifan | Caruana |
| Ju Wenjun vs Lei Tingjie, WCC G12 | 2023 | Ju Wenjun | Lei Tingjie |
## Quickstart
```bash
# Install dependencies
pip install fastapi uvicorn python-chess
# Run the server
python -m chess_pressure.app
uv run chess-pressure
```
The app starts on [http://localhost:8888](http://localhost:8888).
@ -51,11 +52,12 @@ The app starts on [http://localhost:8888](http://localhost:8888).
## Project Structure
```
chess_pressure/
src/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)
static/ # Frontend assets (HTML, JS, CSS, piece images)
```
## License

View File

@ -1,6 +1,6 @@
[project]
name = "chess-pressure"
version = "0.1.1"
version = "0.1.2"
description = "Chess pressure heatmap visualization"
readme = "README.md"
requires-python = ">=3.11"

View File

@ -2,6 +2,7 @@
from __future__ import annotations
from functools import lru_cache
from pathlib import Path
import uvicorn
@ -39,6 +40,7 @@ def list_games():
@app.get("/api/games/{game_id}")
@lru_cache(maxsize=16)
def load_game(game_id: str):
pgn = get_game_pgn(game_id)
if pgn is None:

2
uv.lock generated
View File

@ -41,7 +41,7 @@ sdist = { url = "https://files.pythonhosted.org/packages/93/09/7d04d7581ae3bb8b5
[[package]]
name = "chess-pressure"
version = "0.1.1"
version = "0.1.2"
source = { editable = "." }
dependencies = [
{ name = "fastapi" },