chess
A chess library with move generation and validation, Polyglot opening book probing, PGN reading and writing, Gaviota tablebase probing, Syzygy tablebase probing, and XBoard/UCI engine communication.
Decision gist · record as of 2026-08-14
Yes, for chess applications and analysis tools. The library is stable, actively maintained, and provides a comprehensive pure-Python API with no external runtime dependencies. The GPL-3.0+ copyleft license is appropriate for open-source projects but requires review for proprietary use. High install friction (source distribution) is a minor friction point but not a blocker for most workflows.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later.
- High install friction due to source distribution; no runtime dependencies.
- Actively maintained with recent commits and stable production status across Python 3.8–3.13.
License · maintenance · safety
GPL-3.0+ (copyleft) — GPL-3.0+ copyleft license requires derivative works to be licensed under GPL-3.0 or later; suitable for open-source projects but may restrict commercial or proprietary use.
last release 2025-02-25 (535 days) · last repo commit 2026-07-12 · 2,860 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,739,913 downloads/mo, #2,510 on PyPI
Alternatives
Verify before relying
pip install chess
import chess
board = chess.Board()
board.push_san("e4")
print(board.legal_moves)- Whether high install friction (source-only distribution) impacts typical deployment workflows or CI/CD pipelines.
- Performance characteristics for large-scale move generation or tablebase queries relative to compiled alternatives.
What it is and what it does
python-chess is a pure-Python library for representing, manipulating, and analyzing chess positions and games. It handles move generation and validation, board representation in multiple formats (FEN, EPD, Shredder FEN), and detection of game-ending conditions (checkmate, stalemate, draws). It reads and writes PGN files with comments and variations, probes Polyglot opening books and Syzygy/Gaviota endgame tablebases, and communicates with UCI and XBoard chess engines via asyncio.
The library has no runtime dependencies and includes full type hints. It supports standard chess and variants (Chess960, Atomic, Crazyhouse, and others), integrates with IPython/Jupyter for board visualization, and is actively maintained across modern Python versions. High install friction stems from source-only distribution, though the codebase is stable and production-ready.
Use it for
- Build a chess engine or analysis tool that validates moves and probes endgame tables.
- Parse and replay historical games from PGN files with full move and variation tracking.
- Communicate with external engines (Stockfish, etc.) to evaluate positions and generate best moves.
- Implement chess variants or custom game rules on top of the board representation.
- Analyze opening theory by reading Polyglot opening books and generating legal move sequences.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, for chess applications and analysis tools.
The library is stable, actively maintained, and provides a comprehensive pure-Python API with no external runtime dependencies. The GPL-3.0+ copyleft license is appropriate for open-source projects but requires review for proprietary use. High install friction (source distribution) is a minor friction point but not a blocker for most workflows.
Install
chess on PyPI
Before you install
High install friction due to source distribution; no runtime dependencies. Actively maintained with recent commits and stable production status across Python 3.8–3.13.
Requires Python 3.8 or later.
License in practice
GPL-3.0+ copyleft license requires derivative works to be licensed under GPL-3.0 or later; suitable for open-source projects but may restrict commercial or proprietary use.
Quickstart
pip install chess
import chess
board = chess.Board()
board.push_san("e4")
print(board.legal_moves)
Verify before relying
- Whether high install friction (source-only distribution) impacts typical deployment workflows or CI/CD pipelines.
- Performance characteristics for large-scale move generation or tablebase queries relative to compiled alternatives.
Package facts
| License | GPL-3.0+ copyleft |
| Python support | Supports the current Python release >=3.8 |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Actively maintained 535 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,739,913 / month, #2,510 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)Operating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Games/Entertainment :: Board GamesTopic :: Games/Entertainment :: Turn Based StrategyTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed |
Evidence: chess-1.11.2.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “chess engine communication uci”
- chessA pure-Python chess library providing move generation, validation,…
- python-chesspython-chess provides move generation, move validation, and board…
- stockfishWraps the Stockfish chess engine to let Python code query best moves,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also python-chess · stockfish · nashpy · open-spiel · Box2D · pyglet · memcache-hybrid · PyDirectInput