Skip to content

Tags

Tags give the ability to mark specific points in history as being important
  • v0.15.4
    python-chess v0.15.4
    
    New features:
    
    * Highlight last move and checks when rendering board SVGs.
    
  • v0.15.3
    python-chess v0.15.3
    
    Bugfixes:
    
    * `pgn.Game.errors` was not populated as documented. Thanks to Ryan Delaney
      for reporting.
    
    New features:
    
    * Added `pgn.GameNode.add_line()` and `pgn.GameNode.main_line()` which make
      it easier to work with list of moves as variations.
    
  • v0.15.2
    python-chess v0.15.2
    
    Bugfixes:
    
    * Fix a bug where `shift_right()` and `shift_2_right()` were producing
      integers larger than 64bit when shifting squares off the board. This is
      very similar to the bug fixed in v0.15.1. Thanks to piccoloprogrammatore
      for reporting.
    
  • v0.15.1
    python-chess v0.15.1
    
    Bugfixes:
    
    * Fix a bug where `shift_up_right()` and `shift_up_left()` were producing
      integers larger than 64bit when shifting squares off the board.
    
    New features:
    
    * Replaced __html__ with experimental SVG rendering for IPython.
    
  • v0.15.0
    python-chess v0.15.0
    
    Changes:
    
    * `chess.uci.Score` **no longer has** `upperbound` **and** `lowerbound`
      **attributes**. Previously these were always false.
    
    * Significant improvements of move generation speed, around **2.3x faster
      PGN parsing**. Removed the following internal attributes and methods of
      the `Board` class: `attacks_valid`, `attacks_to`, `attacks_from`,
      `_pinned()`, `attacks_valid_stack`, `attacks_from_stack`, `attacks_to_stack`,
      `generate_attacks()`.
    
    * UCI: Do not send *isready* directly after go. Though allowed by the UCI
      protocol specification it is just not nescessary and many engines were having
      trouble with this.
    
    * Polyglot: Use less memory for uniform random choices from big opening books
      (reservoir sampling).
    
    * Documentation improvements.
    
    Bugfixes:
    
    * Allow underscores in PGN header tags. Found and fixed by Bajusz Tamás.
    
    New features:
    
    * Added `Board.chess960_pos()` to identify the Chess960 starting position
      number of positions.
    
    * Added `chess.BB_BACKRANKS` and `chess.BB_PAWN_ATTACKS`.
    
  • v0.14.1
    python-chess v0.14.1
    
    Bugfixes:
    
    * Backport Bugfix for Syzygy DTZ related to en-passant.
      See official-stockfish/Stockfish@6e2ca97d93812b2.
    
    Changes:
    
    * Added optional argument *max_fds=128* to `chess.syzygy.open_tablebases()`.
      An LRU cache is used to keep at most *max_fds* files open. This allows using
      many tables without running out of file descriptors.
      Previously all tables were opened at once.
    
    * Syzygy and Gaviota now store absolute tablebase paths, in case you change
      the working directory of the process.
    
    * The default implementation of `chess.uci.InfoHandler.score()` will no longer
      store score bounds in `info["score"]`, only real scores.
    
    * Added `Board.set_chess960_pos()`.
    
    * Documentation improvements.
    
  • v0.14.0
    python-chess v0.14.0
    
    Changes:
    
    * `Board.attacker_mask()` **has been renamed to** `Board.attackers_mask()` for
      consistency.
    
    * **The signature of** `Board.generate_legal_moves()` **and**
      `Board.generate_pseudo_legal_moves()` **has been changed.** Previously it
      was possible to select piece types for selective move generation:
    
      `Board.generate_legal_moves(castling=True, pawns=True, knights=True, bishops=True, rooks=True, queens=True, king=True)`
    
      Now it is possible to select arbitrary sets of origin and target squares.
      `to_mask` uses the corresponding rook squares for castling moves.
    
      `Board.generate_legal_moves(from_mask=BB_ALL, to_mask=BB)`
    
      To generate all knight and queen moves do:
    
      `board.generate_legal_moves(board.knights | board.queens)`
    
      To generate only castling moves use:
    
      `Board.generate_castling_moves(from_mask=BB_ALL, to_mask=BB_ALL)`
    
    * Additional hardening has been added on top of the bugfix from v0.13.3.
      Diagonal skewers on the last double pawn move are now handled correctly,
      even though such positions can not be reached with a sequence of legal moves.
    
    * `chess.syzygy` now uses the more efficient selective move generation.
    
    New features:
    
    * The following move generation methods have been added:
      `Board.generate_pseudo_legal_ep(from_mask=BB_ALL, to_mask=BB_ALL)`,
      `Board.generate_legal_ep(from_mask=BB_ALL, to_mask=BB_ALL)`,
      `Board.generate_pseudo_legal_captures(from_mask=BB_ALL, to_mask=BB_ALL)`,
      `Board.generate_legal_captures(from_mask=BB_ALL, to_mask=BB_ALL)`.
    
  • v0.13.3
    python-chess v0.13.3
    
    **This is a bugfix release for a move generation bug.** Other than the bugfix
    itself there are only minimal fully backwardscompatible changes.
    You should update immediately.
    
    Bugfixes:
    
    * When capturing en passant, both the capturer and the captured pawn disappear
      from the fourth or fifth rank. If those pawns were covering a horizontal
      attack on the king, then capturing en passant should not have been legal.
    
      `Board.generate_legal_moves()` and `Board.is_into_check()` have been fixed.
    
      The same principle applies for diagonal skewers, but nothing has been done
      in this release: If the last double pawn move covers a diagonal attack, then
      the king would have already been in check.
    
      v0.14.0 adds additional hardening for all cases. It is recommended you
      upgrade to v0.14.0 as soon as you can deal with the
      non-backwards compatible changes.
    
    Changes:
    
    * `chess.uci` now uses `subprocess32` if applicable (and available).
      Additionally a lock is used to work around a race condition in Python 2, that
      can occur when spawning engines from multiple threads at the same time.
    
    * Consistently handle tabs in UCI engine output.
    
  • v0.13.2
    python-chess v0.13.2
    
    Changes:
    
    * `chess.syzygy.open_tablebases()` now raises if the given directory
      does not exist.
    
    * Allow visitors to handle invalid `FEN` tags in PGNs.
    
    * Gaviota tablebase probing fails faster for piece counts > 5.
    
    Minor new features:
    
    * Added `chess.pgn.Game.from_board()`.
    
  • v0.13.1
    python-chess v0.13.1
    
    Changes:
    
    * Missing *SetUp* tags in PGNs are ignored.
    
    * Incompatible comparisons on `chess.Piece`, `chess.Move`, `chess.Board`
      and `chess.SquareSet` now return *NotImplemented* instead of *False*.
    
    Minor new features:
    
    * Factored out basic board operations to `chess.BaseBoard`. This is inherited
      by `chess.Board` and extended with the usual move generation features.
    
    * Added optional *claim_draw* argument to `chess.Base.is_game_over()`.
    
    * Added `chess.Board.result(claim_draw=False)`.
    
    * Allow `chess.Board.set_piece_at(square, None)`.
    
    * Added `chess.SquareSet.from_square(square)`.
    
  • v0.13.0
    python-chess v0.13.0
    
    * `chess.pgn.Game.export()` and `chess.pgn.GameNode.export()` have been
      removed and replaced with a new visitor concept.
    
    * `chess.pgn.read_game()` no longer takes an `error_handler` argument. Errors
      are now logged. Use the new visitor concept to change this behaviour.
    
  • v0.12.5
    python-chess v0.12.5
    
    Bugfixes:
    
    * Context manager support for pure Python Gaviota probing code. Various
      documentation fixes for Gaviota probing. Thanks to Jürgen Précour for
      reporting.
    
    * PGN variation start comments for variations on the very first move were
      assigned to the game. Thanks to Norbert Räcke for reporting.
    
  • v0.12.4
    python-chess v0.12.4
    
    Bugfixes:
    
    * Another en passant related Bugfix for pure Python Gaviota tablebase probing.
    
    New features:
    
    * Added `pgn.GameNode.is_end()`.
    
    Changes:
    
    * Big speedup for `pgn` module. Boards are cached less agressively. Board
      move stacks are copied faster.
    
    * Added tox.ini to specify test suite and flake8 options.
    
  • v0.12.3
    python-chess v0.12.3
    
    Bugfixes:
    
    * Some invalid castling rights were silently ignored by `Board.set_fen()`. Now
      it is ensured information is stored for retrieval using `Board.status()`.
    
  • v0.12.2
    python-chess v0.12.2
    
    Bugfixes:
    
    * Some Gaviota probe results were incorrect for positions where black could
      capture en passant.
    
  • v0.12.1
    python-chess v0.12.1
    
    Changes:
    
    * Robust handling of invalid castling rights. You can also use the new
      method `Board.clean_castling_rights()` to get the subset of strictly valid
      castling rights.
    
  • v0.12.0
    python-chess v0.12.0
    
    * Python 2.6 support. Patch by vdbergh.
    
    * Pure Python Gaviota tablebase probing. Thanks to Jean-Noël Avila.
    
  • v0.11.1
    python-chess v0.11.1
    
    Bugfixes:
    
    * `syzygy.Tablebases.probe_dtz()` has was giving wrong results for some
      positions with possible en passant capturing. This was found and fixed
      upstream: https://github.com/official-stockfish/Stockfish/issues/394.
    
    * Ignore extra spaces in UCI `info` lines, as for example sent by the
      Hakkapeliitta engine. Thanks to Jürgen Précour for reporting
    
  • v0.11.0
    python-chess v0.11.0
    
    Changes:
    
    * **Chess960** support and the **representation of castling moves** has been
      changed.
    
      The constructor of board has a new `chess960` argument, defaulting to
      `False`: `Board(fen=STARTING_FEN, chess960=False)`. That property is
      available as `Board.chess960`.
    
      In Chess960 mode the behaviour is as in the previous release. Castling moves
      are represented as a king move to the corresponding rook square.
    
      In the default standard chess mode castling moves are represented with
      the standard UCI notation, e.g. `e1g1` for king-side castling.
    
      `Board.uci(move, chess960=None)` creates UCI representations for moves.
      Unlike `Move.uci()` it can convert them in the context of the current
      position.
    
      `Board.has_chess960_castling_rights()` has been added to test for castling
      rights that are impossible in standard chess.
    
      The modules `chess.polyglot`, `chess.pgn` and `chess.uci` will transparently
      handle both modes.
    
    * In a previous release `Board.fen()` has been changed to only display an
      en passant square if a legal en passant move is indeed possible. This has
      now also been adapted for `Board.shredder_fen()` and `Board.epd()`.
    
    New features:
    
    * Get individual FEN components: `Board.board_fen()`, `Board.castling_xfen()`,
      `Board.castling_shredder_fen()`.
    
    * Use `Board.has_legal_en_passant()` to test if a position has a legal
      en passant move.
    
    * Make `repr(board.legal_moves)` human readable.
    
  • v0.10.1
    python-chess v0.10.1
    
    Bugfixes:
    
    * Fix use-after-free in Gaviota tablebase initialization.