Releases: niklasf/python-chess
python-chess v0.8.0
New in this release:
- Implement Syzygy endgame tablebase probing.
https://syzygy-tables.info is an example project that provides a public API using the new features. - The interface for aynchronous UCI command has changed to mimic
concurrent.futures
.is_done()
is now justdone()
. Callbacks will receive the command object as a single argument instead of the result. Theresult
property andwait()
have been removed in favor of a synchronously waitingresult()
method. - The result of the
stop
andgo
UCI commands are now named tuples (instead of just normal tuples). - Add alias
Board
forBitboard
. - Fixed race condition during UCI engine startup. Lines received during engine startup sometimes needed to be processed before the Engine object was fully initialized.
python-chess v0.7.0
New in this release:
- Implement UCI engine communication.
- Patch by Matthew Lai:
Add caching for gameNode.board()
.
python-chess v0.6.0
New in this release:
- If there are comments in a game before the first move, these are now assigned
toGame.comment
instead ofGame.starting_comment
.Game.starting_comment
is ignored from now on.Game.starts_variation()
is no longer true.
The first child node of a game can no longer have a starting comment.
It is possible to have a game withGame.comment
set, that is otherwise
completely empty. - Fix export of games with variations. Previously the moves were exported in
an unusual (i.e. wrong) order. - Install
gmpy2
orgmpy
if you want to use slightly faster binary
operations. - Ignore superfluous variation opening brackets in PGN files.
- Add
GameNode.san()
. - Remove
sparse_pop_count()
. Just usepop_count()
. - Remove
next_bit()
. Now usebit_scan()
.
python-chess v0.5.0
New in this release:
-
PGN parsing is now more robust:
read_game()
ignores invalid tokens.
Still exceptions are going to be thrown on illegal or ambiguous moves, but
this behaviour can be changed by passing anerror_handler
argument.>>> # Raises ValueError: >>> game = chess.pgn.read_game(file_with_illegal_moves) >>> # Silently ignores errors and continues parsing: >>> game = chess.pgn.read_game(file_with_illegal_moves, None) >>> # Logs the error, continues parsing: >>> game = chess.pgn.read_game(file_with_illegal_moves, logger.exception)
If there are too many closing brackets this is now ignored.
Castling moves like 0-0 (with zeros) are now accepted in PGNs.
TheBitboard.parse_san()
method remains strict as always, though.Previously the parser was strictly following the PGN spefification in that
empty lines terminate a game. So a game like[Event "?"] { Starting comment block } 1. e4 e5 2. Nf3 Nf6 *
would have ended directly after the starting comment. To avoid this, the
parser will now look ahead until it finds at least one move or a termination
marker like*
,1-0
,1/2-1/2
or0-1
. -
Introduce a new function
scan_headers()
to quickly scan a PGN file for
headers without having to parse the full games. -
Minor testcoverage improvements.
python-chess v0.4.2
New in this release:
- Fix bug where
pawn_moves_from()
and consequentlyis_legal()
weren't
handling en-passant correctly. Thanks to Norbert Naskov for reporting.
python-chess v0.4.1
New in this release:
- Fix
is_fivefold_repitition()
: The new fivefold repitition rule requires
the repititions to occur on alternating consecutive moves. - Minor testing related improvements: Close PGN files, allow running via
setuptools. - Add recently introduced features to README.
python-chess v0.4.0
New in this release:
- Introduce
can_claim_draw()
,can_claim_fifty_moves()
and
can_claim_threefold_repitition()
. - Since the first of July 2014 a game is also over (even without claim by one
of the players) if there were 75 moves without a pawn move or capture or
a fivefold repitition. Letis_game_over()
respect that. Introduce
is_seventyfive_moves()
andis_fivefold_repitition()
. Other means of
ending a game take precedence. - Threefold repitition checking requires efficient hashing of positions
to build the table. So performance improvements were needed there. The
default polyglot compatible zobrist hashes are now built incrementally. - Fix low level rotation operations
l90()
,l45()
andr45()
. There was
no problem in core because correct versions of the functions were inlined. - Fix equality and inequality operators for
Bitboard
,Move
andPiece
.
Also make them robust against comparisons with incompatible types. - Provide equality and inequality operators for
SquareSet
and
polyglot.Entry
. - Fix return values of incremental arithmetical operations for
SquareSet
. - Make
polyglot.Entry
acollections.namedtuple
. - Determine and improve test coverage.
- Minor coding style fixes.
python-chess v0.3.1
New in this release:
Bitboard.status()
now correctly detectsSTATUS_INVALID_EP_SQUARE
,
instead of errors or false reports.- Polyglot opening book reader now correctly handles knight underpromotions.
- Minor coding style fixes, including removal of unused imports.
python-chess v0.3.0
New in this release:
-
Rename property
half_moves
ofBitboard
tohalfmove_clock
. -
Rename property
ply
ofBitboard
tofullmove_number
. -
Let PGN parser handle symbols like
!
,?
,!?
and so on by converting
them to NAGs. -
Add a human readable string representation for Bitboards.
>>> print(chess.Bitboard()) r n b q k b n r p p p p p p p p . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P P P P P P P P R N B Q K B N R
-
Various documentation improvements.
python-chess v0.2.0
New in this release:
- Implement PGN parsing and writing.
- Hugely improve test coverage and use Travis CI for continuous integration and
testing. - Create an API documentation.
- Improve Polyglot opening-book handling.