Skip to content

Tags: arvindpdmn/python-chess

Tags

v0.20.1

Toggle v0.20.1's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.20.1

Bugfixes:

* Fix arrow positioning on SVG boards.
* Documentation fixes and improvements, making most doctests runnable.

v0.20.0

Toggle v0.20.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.20.0

Bugfixes:

* Some XBoard commands were not returning futures.
* Support semicolon comments in PGNs.

Changes:

* Changed FEN and EPD formatting options. It is now possible to include en
  passant squares in FEN and X-FEN style, or to include only strictly relevant
  en passant squares.
* Relax en passant square validation in `Board.set_fen()`.
* Ensure `is_en_passant()`, `is_capture()`, `is_zeroing()` and
  `is_irreversible()` strictly return bools.
* Accept `Z0` as a null move in PGNs.

New features:

* XBoard: Add `memory`, `core`, `stop` and `movenow` commands.
  Abstract `post`/`nopost`. Initial `FeatureMap` support. Support `usermove`.
* Added `Board.has_pseudo_legal_en_passant()`.
* Added `Board.piece_map()`.
* Added `SquareSet.carry_rippler()`.
* Factored out some (unstable) low level APIs: `BB_CORNERS`,
  `_carry_rippler()`, `_edges()`.

v0.19.0

Toggle v0.19.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.19.0

New features:

* **Experimental XBoard engine support.** Thanks to Manik Charan and
  Cash Costello. Expect breaking changes in future releases.
* Added an undocumented `chess.polyglot.ZobristHasher` to make Zobrist hashing
  easier to extend.

Bugfixes:

* Merely pseudo-legal en passant does no longer count for repetitions.
* Fixed repetition detection in Three-Check and Crazyhouse. (Previously
  check counters and pockets were ignored.)
* Checking moves in Three-Check are now considered as irreversible by
  `ThreeCheckBoard.is_irreversible()`.
* `chess.Move.from_uci("")` was raising `IndexError` instead of `ValueError`.
  Thanks Jonny Balls.

Changes:

* `chess.syzygy.Tablebases` constructor no longer supports directly opening
  a directory. Use `chess.syzygy.open_tablebases()`.
* `chess.gaviota.PythonTablebases` and `NativeTablebases` constructors
  no longer support directly opening a directory.
  Use `chess.gaviota.open_tablebases()`.
* `chess.Board` instances are now compared by the position they represent,
  not by exact match of the internal data structures (or even move history).
* Relaxed castling right validation in Chess960: Kings/rooks of opposing sites
  are no longer required to be on the same file.
* Removed misnamed `Piece.__unicode__()` and `BaseBoard.__unicode__()`. Use
  `Piece.unicode_symbol()` and `BaseBoard.unicode()` instead.
* Changed `chess.SquareSet.__repr__()`.
* Support `[Variant "normal"]` in PGNs.
* `pip install python-chess[engine]` instead of `python-chess[uci]` (since
  the extra dependencies are required for both UCI and XBoard engines).
* Mixed documentation fixes and improvements.

v0.18.4

Toggle v0.18.4's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.18.4

Changes:

* Support `[Variant "fischerrandom"]` in PGNs for Cutechess compability.
  Thanks to Steve Maughan for reporting.

v0.18.3

Toggle v0.18.3's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.18.3

Bugfixes:

* `chess.gaviota.NativeTablebases.get_dtm()` and `get_wdl()` were missing.

v0.18.2

Toggle v0.18.2's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.18.2

Bugfixes:

* Fixed castling in atomic chess when there is a rank attack.
* The halfmove clock in Crazyhouse is no longer incremented unconditionally.
  `CrazyhouseBoard.is_zeroing(move)` now considers pawn moves and captures as
  zeroing. Added `Board.is_irreversible(move)` that can be used instead.
* Fixed an inconsistency where the `chess.pgn` tokenizer accepts long algebraic
  notation but `Board.parse_san()` did not.

Changes:

* Added more NAG constants in `chess.pgn`.

v0.18.1

Toggle v0.18.1's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.18.1

Bugfixes:

* Crazyhouse drops were accepted as pseudo legal (and legal) even if the
  respective piece was not in the pocket.
* `CrazyhouseBoard.pop()` was failing to undo en passant moves.
* `CrazyhouseBoard.pop()` was always returning `None`.
* `Move.__copy__()` was failing to copy Crazyhouse drops.
* Fix ~ order (marker for promoted pieces) in FENs.
* Promoted pieces in Crazyhouse were not communicated with UCI engines.

Changes:

* `ThreeCheckBoard.uci_variant` changed from `threecheck` to `3check`.

v0.18.0

Toggle v0.18.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.18.0

Bugfixes:

* Fixed `Board.parse_uci()` for crazyhouse drops. Thanks to Ryan Delaney.
* Fixed `AtomicBoard.is_insufficient_material()`.
* Fixed signature of `SuicideBoard.was_into_check()`.
* Explicitly close input and output streams when a `chess.uci.PopenProcess`
  terminates.
* The documentation of `Board.attackers()` was wrongly stating that en passant
  capturable pawns are considered attacked.

Changes:

* `chess.SquareSet` is no longer hashable (since it is mutable).
* Removed functions and constants deprecated in v0.17.0.
* Dropped `gmpy2` and `gmpy` as optional dependencies. They were no longer
  improving performance.
* Various tweaks and optimizations for 5% improvement in PGN parsing and perft
  speed. (Signature of `_is_safe` and `_ep_skewered` changed).
* Rewritten `chess.svg.board()` using `xml.etree`. No longer supports *pre* and
  *post*. Use an XML parser if you need to modify the SVG. Now only inserts
  actually used piece defintions.
* Untangled UCI process and engine instanciation, changing signatures of
  constructors and allowing arbitrary arguments to `subprocess.Popen`.
* Coding style and documentation improvements.

New features:

* `chess.svg.board()` now supports arrows. Thanks to @rheber for implementing
  this feature.
* Let `chess.uci.PopenEngine` consistently handle Ctrl+C across platforms
  and Python versions. `chess.uci.popen_engine()` now supports a `setpgrp`
  keyword argument to start the engine process in a new process group.
  Thanks to @dubiousjim.
* Added `board.king(color)` to find the (royal) king of a given side.
* SVGs now have `viewBox` and `chess.svg.board(size=None)` supports and
  defaults to `None` (i.e. scaling to the size of the container).

v0.17.0

Toggle v0.17.0's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.17.0

Changes:

* Rewritten move generator, various performance tweaks, code simplications
  (500 lines removed) amounting to **doubled PGN parsing and perft speed**.
* Removed `board.generate_evasions()` and `board.generate_non_evasions()`.
* Removed `board.transpositions`. Transpositions are now counted on demand.
* `file_index()`, `rank_index()`, and `pop_count()` have been renamed to
  `square_file()`, `square_rank()` and `popcount()` respectively. Aliases will
  be removed in some future release.
* `STATUS_ILLEGAL_CHECK` has been renamed to `STATUS_RACE_CHECK`. The alias
  will be removed in a future release.
* Removed `DIAG_ATTACKS_NE`, `DIAG_ATTACKS_NW`, `RANK_ATTACKS` and
  `FILE_ATTACKS` as well as the corresponding masks. New attack tables
  `BB_DIAG_ATTACKS` (combined both diagonal tables), `BB_RANK_ATTACKS` and
  `BB_FILE_ATTACKS` are indexed by square instead of mask.
* `board.push()` no longer requires pseudo-legality.
* Documentation improvements.

Bugfixes:

* **Positions in variant end are now guaranteed to have no legal moves.**
  `board.is_variant_end()` has been added to test for special variant end
  conditions. Thanks to salvador-dali.
* `chess.svg`: Fixed a typo in the class names of black queens. Fixed fill
  color for black rooks and queens. Added SVG Tiny support. These combined
  changes fix display in a number of applications, including
  Jupyter Qt Console. Thanks to Alexander Meshcheryakov.
* `board.ep_square` was not consistently `None` instead of `0`.
* Detect invalid racing kings positions: `STATUS_RACE_OVER`,
  `STATUS_RACE_MATERIAL`.
* `SAN_REGEX`, `FEN_CASTLING_REGEX` and `TAG_REGEX` now try to match the
  entire string and no longer accept newlines.
* Fixed `Move.__hash__()` for drops.

New features:

* `board.remove_piece_at()` now returns the removed piece.
* Added `square_distance()` and `square_mirror()`.
* Added `msb()`, `lsb()`, `scan_reversed()` and `scan_forward()`.
* Added `BB_RAYS` and `BB_BETWEEN`.

v0.16.2

Toggle v0.16.2's commit message

Verified

This tag was signed with the committer’s verified signature.
niklasf Niklas Fiekas
python-chess v0.16.2

Changes:

* `board.move_stack` now contains the exact move objects added with
  `Board.push()` (instead of normalized copies for castling moves).
  This ensures they can be used with `Board.variation_san()` amongst others.
* `board.ep_square` is now `None` instead of `0` for no en passant square.
* `chess.svg`: Better vector graphics for knights. Thanks to ProgramFox.
* Documentation improvements.