Package: berserk
Python client for theLichess API.This is based on theoriginal berserk version created by rhgrant10and theberserk-downstream fork created by ZackClements. Big thanks to them and all other contributors!DocumentationInstallationRequires Python 3.8+. Download and install the latest release:pip3 install berserkIf you haveberserk-downstreaminstalled, make sure to uninstall it first!Featureshandles (ND)JSON and PGN formats at user’s discretiontoken auth sessioneasy integration with OAuth2automatically converts time values to datetimesUsageYou can use anyrequests.Session-like object as a session, including those
fromrequests_oauth. A simple token session is included, as shown below:importberserksession=berserk.TokenSession(API_TOKEN)client=berserk.Client(session=session)Most of the API is available:client.account.getclient.account.get_emailclient.account.get_preferencesclient.account.get_kid_modeclient.account.set_kid_modeclient.account.upgrade_to_botclient.analysis.get_cloud_evaluationclient.board.stream_incoming_eventsclient.board.seekclient.board.stream_game_stateclient.board.make_moveclient.board.post_messageclient.board.get_game_chatclient.board.abort_gameclient.board.resign_gameclient.board.handle_draw_offerclient.board.offer_drawclient.board.accept_drawclient.board.decline_drawclient.board.handle_takeback_offerclient.board.offer_takebackclient.board.accept_takebackclient.board.decline_takebackclient.board.claim_victoryclient.board.go_berserkclient.bots.get_online_botsclient.bots.stream_incoming_eventsclient.bots.stream_game_stateclient.bots.make_moveclient.bots.post_messageclient.bots.abort_gameclient.bots.resign_gameclient.bots.accept_challengeclient.bots.decline_challengeclient.broadcasts.get_officialclient.broadcasts.createclient.broadcasts.getclient.broadcasts.updateclient.broadcasts.push_pgn_updateclient.broadcasts.create_roundclient.broadcasts.get_roundclient.broadcasts.update_roundclient.broadcasts.get_round_pgnsclient.broadcasts.get_pgnsclient.broadcasts.stream_roundclient.bulk_pairings.get_upcomingclient.bulk_pairings.createclient.bulk_pairings.start_clocksclient.bulk_pairings.cancelclient.challenges.get_mineclient.challenges.createclient.challenges.create_aiclient.challenges.create_openclient.challenges.create_with_acceptclient.challenges.acceptclient.challenges.declineclient.challenges.cancelclient.challenges.start_clocksclient.challenges.add_time_to_opponent_clockclient.challenges.create_tokens_for_multiple_usersclient.explorer.get_lichess_gamesclient.explorer.get_masters_gamesclient.explorer.get_player_gamesclient.explorer.stream_player_gamesclient.explorer.get_otb_master_gameclient.external_engine.getclient.external_engine.get_by_idclient.external_engine.createclient.external_engine.updateclient.external_engine.deleteclient.games.exportclient.games.export_ongoing_by_playerclient.games.export_by_playerclient.games.export_multiclient.games.get_among_playersclient.games.stream_games_by_idsclient.games.add_game_ids_to_streamclient.games.get_ongoingclient.games.stream_game_movesclient.games.get_tv_channelsclient.games.import_gameclient.messaging.sendclient.oauth.test_tokensclient.puzzles.get_dailyclient.puzzles.getclient.puzzles.get_puzzle_activityclient.puzzles.get_puzzle_dashboardclient.puzzles.get_storm_dashboardclient.puzzles.create_raceclient.relations.get_users_followedclient.relations.followclient.relations.unfollowclient.simuls.getclient.studies.export_chapterclient.studies.exportclient.studies.export_by_usernameclient.tablebase.look_upclient.tablebase.standardclient.tablebase.atomicclient.tablebase.antichessclient.teams.get_membersclient.teams.joinclient.teams.leaveclient.teams.kick_memberclient.teams.get_join_requestsclient.teams.accept_join_requestclient.teams.decline_join_requestclient.teams.get_teamclient.teams.teams_of_playerclient.teams.get_popularclient.teams.searchclient.teams.message_all_membersclient.tournaments.edit_swissclient.tournaments.getclient.tournaments.get_tournamentclient.tournaments.get_swissclient.tournaments.get_team_standingsclient.tournaments.update_team_battleclient.tournaments.create_arenaclient.tournaments.create_swissclient.tournaments.export_arena_gamesclient.tournaments.export_swiss_gamesclient.tournaments.export_swiss_trfclient.tournaments.arena_by_teamclient.tournaments.swiss_by_teamclient.tournaments.join_arenaclient.tournaments.join_swissclient.tournaments.terminate_arenaclient.tournaments.terminate_swissclient.tournaments.tournaments_by_userclient.tournaments.stream_resultsclient.tournaments.stream_swiss_resultsclient.tournaments.stream_by_creatorclient.tournaments.withdraw_arenaclient.tournaments.withdraw_swissclient.tournaments.schedule_swiss_next_roundclient.tv.get_current_gamesclient.tv.stream_current_gameclient.tv.get_best_ongoingclient.users.get_realtime_statusesclient.users.get_all_top_10client.users.get_leaderboardclient.users.get_public_dataclient.users.get_activity_feedclient.users.get_by_idclient.users.get_by_teamclient.users.get_live_streamersclient.users.get_rating_historyclient.users.get_crosstableclient.users.get_user_performanceclient.users.get_by_autocompleteDetails for each function can be found in thedocumentation.