♟️ Chess Post-Game Analyst
A professional, production-ready chess game analysis tool with interactive web interface
Features • Quick Start • Installation • Documentation • Contributing
🎯 Features
Core Analysis
- ✨ Deep Game Analysis - Powered by Stockfish engine for accurate position evaluation
- 🎯 Move Classification - Identifies brilliant moves, blunders, mistakes, and inaccuracies
- 📊 Accuracy Metrics - Calculate player accuracy and performance ratings
- 🔍 Critical Moments - Highlight turning points and missed opportunities
- 📝 PGN Support - Parse and analyze standard PGN (Portable Game Notation) files
Interactive Web Interface
- ♟️ Interactive Chessboard - Replay games move-by-move with visual position display
- 📈 Evaluation Graph - See position evaluation change throughout the game
- 🧠 Coaching Tips - Get beginner-friendly explanations for every type of mistake
- 📋 Paste PGN - Analyze games directly from clipboard without file upload
- ⭐ Sample Games - Try analysis with pre-loaded famous games
- ⌨️ Keyboard Controls - Navigate with arrow keys for quick replay
- 📱 Responsive Design - Works seamlessly on desktop, tablet, and mobile
Output Formats
- 📄 JSON - Machine-readable format for integration
- 📝 Text - Human-readable analysis reports
- 🌐 HTML - Rich formatted reports with diagrams
- 📊 Statistics - Detailed game statistics and insights
Production Features
- 🐳 Docker Support - Easy deployment with Docker and docker-compose
- ⚡ Fast Performance - Optimized for analyzing multiple games
- 🔒 Error Handling - Robust error handling and logging
- ✅ Well Tested - Comprehensive unit and integration tests
- 📚 Documentation - Complete API and usage documentation
🚀 Quick Start for Beginners
Never analyzed a chess game before? No problem! Here's how to get started in 3 minutes:
-
Export your game as a PGN file:
- On Chess.com: Archive → Click game → Share → Download PGN
- On Lichess: Click game → Export → Download PGN
-
Visit Chess Analyst and upload your file
-
Review your analysis - see your mistakes, accuracy, and get tips to improve!
Or try instantly: Click "Try Sample" to analyze a famous game without uploading anything!
📚 New to chess analysis? Read our Complete Beginner's Guide
🚀 Installation
Prerequisites
- Python 3.8 or higher
- Stockfish chess engine (Download Here)
Quick Install
# Clone the repository
git clone https://github.com/lekhanpro/chess-post-game-analyst.git
cd chess-post-game-analyst
# Install dependencies
pip install -r requirements.txt
# Install the package
pip install -e .
Docker Installation
# Build and run with Docker Compose
docker-compose up -d
# Access web interface at http://localhost:5000
💡 Usage
Command Line Interface
Basic Analysis
# Analyze a single PGN file
chess-analyst analyze game.pgn
# Specify output format
chess-analyst analyze game.pgn --format json
# Save analysis to file
chess-analyst analyze game.pgn --output analysis.txt
Advanced Options
# Analyze with custom engine depth
chess-analyst analyze game.pgn --depth 20
# Show only blunders and mistakes
chess-analyst analyze game.pgn --threshold mistake
# Analyze multiple games
chess-analyst analyze games/*.pgn --output results/
Configuration
# Set Stockfish engine path
chess-analyst config --engine-path /usr/local/bin/stockfish
# View current configuration
chess-analyst config --show
Web Interface
# Start the web server
python web/app.py
# Or use the CLI command
chess-analyst serve --port 5000
Then open your browser to http://localhost:5000
Python API
from chess_analyst import GameAnalyzer, PGNParser
# Load a game
parser = PGNParser("game.pgn")
game = parser.load_game()
# Analyze the game
analyzer = GameAnalyzer(engine_path="/usr/local/bin/stockfish")
analysis = analyzer.analyze(game)
# Get results
for move_analysis in analysis.moves:
print(f"Move {move_analysis.move_number}: {move_analysis.classification}")
print(f"Evaluation: {move_analysis.evaluation}")
📊 Sample Output
CLI Output
♟️ Chess Game Analysis Report
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Game Information:
White: Magnus Carlsen (2863)
Black: Hikaru Nakamura (2829)
Event: World Blitz Championship 2024
Result: 1-0
Overall Statistics:
White Accuracy: 94.2%
Black Accuracy: 87.6%
Total Moves: 42
Critical Positions: 5
Move Analysis:
✨ Brilliant Moves: 2
✅ Good Moves: 35
⚠️ Inaccuracies: 3
❌ Mistakes: 1
💥 Blunders: 1
Key Moments:
Move 18: Black missed winning continuation (-3.2 → +0.5)
Move 24: White found brilliant tactical shot (+0.8 → +4.1)
Move 31: Black blunder lost the game (+2.1 → +8.4)
🛠️ Development
Setup Development Environment
# Install development dependencies
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit install
Running Tests
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=chess_analyst --cov-report=html
# Run specific test file
pytest tests/test_analyzer.py
Code Quality
# Format code
black chess_analyst/
# Lint code
flake8 chess_analyst/
# Type checking
mypy chess_analyst/
📚 Documentation
🤝 Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Quick Start for Contributors
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- python-chess - Chess library for Python
- Stockfish - Powerful chess engine
- chessboard.js - JavaScript chessboard component
- The chess community for continuous inspiration
📧 Contact
Project Maintainer: @lekhanpro
Project Link: https://github.com/lekhanpro/chess-post-game-analyst
Made with ♟️ by chess enthusiasts, for chess enthusiasts
⭐ Star this repository if you find it helpful!
Metadata
Release files for chess-post-analyst 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chess_post_analyst-1.0.1.tar.gz | 22.0 kB | Without provenance | Details for chess_post_analyst-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chess_post_analyst-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for chess_post_analyst-1.0.1-py3-none-any.whl |
Total release size: 43.7 kB
Release files / chess_post_analyst-1.0.1.tar.gz
| Download URL | chess_post_analyst-1.0.1.tar.gz |
|---|---|
| Size | 22.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b30f80184d0bf91372d4957965df8531dc7173cd611f3aa2953042deea7adc0c
|
|
BLAKE2b-256 checksum How to use checksums |
c4b1c7e734a5d9310f140a2978668869d2ed4e62c518d8cc82ad3c56a37db2fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Release files / chess_post_analyst-1.0.1-py3-none-any.whl
| Download URL | chess_post_analyst-1.0.1-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d19378a6b77994e0b7f9462c20b8f72cc6c01c9b0912248a65ca22ebe3eeebab
|
|
BLAKE2b-256 checksum How to use checksums |
7ff931d8ae9c4fcfbc735efd11b0fcd7116cb621be600c3ec3b9e18f46c4e7c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.1
|
Security for chess-post-analyst 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.