This repository is deprecated and only here for historical reasons. The new repository can be found at https://github.com/LiBoard/Python.
The LiBoard Python module is used by the provided scripts and can be used for your own scripts. It handles the connection to the board and detecting legal moves played.
pip install git+https://github.com/LiBoard/Python-moduleimportargparsefromliboardimportLiBoard, ARGUMENT_PARSERdefmain(_args: argparse.Namespace):
board=LiBoard(_args.port, _args.baud_rate, _args.move_delay)
@board.start_handlerdefprint_start(_board: LiBoard) ->bool:
# Your code herereturnFalse@board.move_handlerdefprint_move(_board: LiBoard, _move: chess.Move) ->bool:
# Your code herereturnFalsewhileTrue:
board.update()
if__name__=='__main__':
args=argparse.ArgumentParser(parents=[ARGUMENT_PARSER]).parse_args()
try:
main(args)
exceptKeyboardInterrupt:
pass