Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Project Files
bot-upgrade.py
This script allows you to upgrade a regular Lichess account into a bot account. The
upgrade_to_bot_account
function sends a POST request to the Lichess API to convert the account to a bot.upgrade_to_bot_account(api_token: str)
: Upgrades a Lichess account to a bot account using the provided API token.Source file: bot-upgrade.py
create_chess_video.py
This script generates a video replay of a chess game based on a PGN file. It uses Pygame to create frames of the chessboard, saving each as an image, and then uses
ffmpeg
to compile these images into a video.ffmpeg
.Source file: create_chess_video.py
decode.py
This script decodes a file that has been encoded into PGN-formatted chess games. The
decode
function reads a PGN string, decodes the binary data from chess moves, and reconstructs the original file.decode(pgn_string: str, output_file_path: str)
: Decodes a file from a PGN string and writes it to the output file path.run_decoder()
: CLI interface for decoding PGN games to files.Source file: decode.py
encode.py
This script encodes a file into a series of chess games stored in PGN format. It reads the binary data from a file, converts it into chess moves, and stores the moves as PGN games.
encode(file_path: str)
: Encodes a file into chess games in PGN format.run_encoder()
: CLI interface for encoding files to PGN format.Source file: encode.py
api.py
This script automates chess matches between two Lichess bot accounts. It includes functions for challenging a bot, accepting a challenge, and playing a sequence of predefined PGN moves between two bots.
Source file: api.py
Special Thanks