skillfed

python-chess

A chess library with move generation, move validation, and support for common formats.

python-chess v1.999 6.0M downloads/30d#1,999 on PyPI2,860
Copyleft license GPL-3.0+ Active released

What it is and what it does

python-chess is a pure-Python library for representing, validating, and manipulating chess games. It handles standard chess and multiple variants (Chess960, Atomic, Crazyhouse, etc.), generates legal moves, detects game-ending conditions (checkmate, stalemate, draws), and parses/generates common chess formats like FEN, PGN, EPD, and SAN notation. The library also integrates with opening books (Polyglot), endgame tablebases (Syzygy and Gaviota), and external UCI/XBoard chess engines for analysis and play.

The package is primarily used for chess analysis tools, game replay systems, engine interfaces, and educational chess applications. It has low install friction as a pure-Python wheel but carries a GPL-3.0+ copyleft license that restricts use in proprietary software. The codebase shows recent repository activity, but the latest PyPI release dates to 2020, and the package is marked as inactive in its classifiers, creating uncertainty about ongoing maintenance and support.

Use it for:

  • Analyze chess games by parsing PGN files and replaying moves with full move validation and game-state detection.
  • Build a chess engine interface to communicate with UCI engines like Stockfish for position evaluation and move suggestions.
  • Generate legal moves and validate user input in a chess application or game UI.
  • Probe endgame tablebases (Syzygy or Gaviota) to determine optimal play in simplified positions.
  • Read opening books in Polyglot format to suggest common opening moves from a database.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

python-chess provides move generation, move validation, and board representation for chess games, with support for standard and variant chess rules, PGN/FEN/EPD formats, opening books, endgame tablebases, and UCI engine communication.

Yes, with conditions. The library is feature-complete for standard chess programming tasks and has no known vulnerabilities. However, the GPL-3.0+ copyleft license is a hard blocker for proprietary projects, and the gap between the latest release (2020-10-26) and current date raises questions about maintenance responsiveness. Install only if you need GPL-compatible licensing and can tolerate potential delays in bug fixes or updates.

Install

python-chess on PyPI

pip

pip install python-chess

uv

uv add python-chess

poetry

poetry add python-chess

Installing python-chess

Before you install

Low install friction with a pure-Python wheel distribution. However, the package is marked as inactive (Development Status 7) despite an active repository; the latest release is from 2020-10-26, over five years old, which may indicate maintenance has stalled even though the repository shows recent commits.

License in practice

Licensed under GPL-3.0+, a copyleft license requiring any derivative work or distribution to also be open-source under compatible terms. This is a significant constraint for proprietary or closed-source projects.

Quickstart

pip install chess

import chess

board = chess.Board()
board.push_san("e4")
print(board)

Requires Python 3.8+ according to the documentation excerpt.

Verify before relying

  • Whether the package is actively maintained despite the 2020 release date and 'Inactive' classifier conflicting with recent repository commits.
  • Current Python version support beyond the 3.8+ minimum mentioned in the excerpt.
  • Whether all documented features (Polyglot, Syzygy, Gaviota, UCI engines) are fully functional in version 1.999.

Package facts

License GPL-3.0+ (copyleft)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — chess
Maintenance actively maintained — 2,118 days since the last release
Last repo commit
First released
Downloads 5,969,961/month — #1,999 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_chess-1.999-py3-none-any.whl

Keywords: chess, fen, epd, pgn, polyglot, syzygy, gaviota, uci, xboard

Development Status :: 7 - Inactive

Tags

chess board representationmove generation validationpgn parserchess engine communicationchess game analysisfen notationchess variants
chess-game-logicgame-developmentcopyleft-licensed

More Software Development packages