Game

Utilities for creating and navigating games

game()

Create a new game

move()

Make moves and create variations

root()

Get the root node of a game

forward()

Advance in the game tree, playing next move from current branch

back()

Go back in the game tree, reverting the last move from current branch

variations()

Get all variations for next move (the children of current node)

variation()

Follow variation of a move, playing its first move

`%>%`

Pipe operator

Analysis

Utilities for the Stockfish engine

fish_configure()

Configure and start Stockfish engine

fish_move()

Have Stockfish play the next move

Annotations

Utilities for adding and exporting game annotations

nag()

Parse Numeric Annotation Glyph (NAG) of a move

note()

Get comment for a move

PGN

Utilities for reading and writing games

read_game()

Read a game from a PGN

write_game()

Save a game as an PGN

pgn()

Get PGN for node of a game

Printing and plotting

Utilities for printing and plotting

print(<chess.Board>)

Print board

print(<chess.pgn.GameNode>)

Print game node

print(<chess.pgn.Variations>)

Print a list of variations

plot(<chess.pgn.GameNode>)

Plot rendering of the board

write_svg()

Save an SVG with rendering of the board

Python

Utilities for using Python

install_chess()

Install python-chess

Meta

Utilities for getting information about the state of the game

fen()

Get FEN representation of board

turn()

Get whose turn it is

move_number()

Get number of move

ply_number()

Get number of ply

halfmove_clock()

Get number of half-moves since the last capture or pawn move

result()

Get result of the game ("*" if it hasn't ended)

moves()

Get all legal moves available

is_checkmate() is_check() is_game_over() is_stalemate() is_insufficient_material() is_seventyfive_moves() is_fivefold_repetition() is_repetition() can_claim_draw() can_claim_fifty_moves() can_claim_threefold_repetition() has_en_passant()

Get information about the current board

gives_check() is_en_passant() is_capture() is_zeroing() is_irreversible() is_castling() is_kingside_castling() is_queenside_castling()

Get information about the current board given a move

has_insufficient_material() has_castling_rights() has_kingside_castling_rights() has_queenside_castling_rights()

Get information about the current board given a color