# niklasf/python-chess

A chess library for Python, with move generation and validation, PGN parsing and writing, Polyglot opening book reading, Gaviota tablebase probing, Syzygy tablebase probing, and UCI/XBoard engine communication

Repository: https://github.com/niklasf/python-chess
Canonical: https://ross.abutalabs.com/products/python-chess
Homepage: https://python-chess.readthedocs.io/en/latest/
Language: Python
License: GPL-3.0
License Family: copyleft
Topics: chess, fen, epd, pgn, polyglot, syzygy, gaviota, uci, xboard
Last push: 2026-08-22T13:17:47+00:00

## Health v2 (maintenance only)
Score: 74/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 28, longevity 100
- inputs: {"age_days": 5083, "days_push": 11, "days_rel": 554, "gap_med": 72.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2864, forks 583 (observed 2026-08-28T04:07:26.500036+00:00)

## What it is
python-chess is a Python library for chess with move generation, move validation, and support for common formats like PGN, FEN, and EPD. It also provides Polyglot opening book reading, Syzygy/Gaviota tablebase probing, and UCI/XBoard engine communication.

## Use cases
- generate and validate legal chess moves in Python
- parse and write PGN chess game files
- communicate with UCI chess engines like Stockfish
- probe Syzygy endgame tablebases
- build a chess bot or analysis tool
- render chess boards in Jupyter notebooks
- work with chess variants like Chess960 and Atomic

## When to choose
- you need reliable chess rules and move generation in Python
- you want to interface Python with UCI/XBoard chess engines
- you need to parse or write PGN/FEN/EPD chess formats
- you are building chess analysis, bot, or educational tools

## When to avoid
- you need a chess GUI or playable game interface
- you need a high-performance engine in another language
- you are working with non-chess board games

## Facets
- artifact type: library
- maturity: stable
- function: parser, sdk, developer-tools
- domain: gaming-tools, developer-tools
- platform: python, cross-platform
- tags: chess, pgn, fen, uci, xboard, tablebase, syzygy, polyglot, game-logic, engine-communication, algorithms

## Member repositories
- niklasf/python-chess (main) score 74

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:26.500036+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:48:29.223933+00:00, confidence not recorded.
  - readme: https://github.com/niklasf/python-chess (fetched 2026-08-28T04:07:26.500036+00:00, sha ea9c20369684)
  - registry_pypi: https://pypi.org/pypi/python-chess/json (fetched 2026-08-29T09:52:24.847414+00:00, sha 5247b29045a4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
