From 92c727c604c581bc1633e31b10dfa067b82ae7f7 Mon Sep 17 00:00:00 2001 From: Sam Ezeh Date: Fri, 9 Apr 2021 22:26:08 +0100 Subject: [PATCH 1/2] Add get_tournament() method --- berserk/clients.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/berserk/clients.py b/berserk/clients.py index 5a6ce37..57aa5fc 100644 --- a/berserk/clients.py +++ b/berserk/clients.py @@ -883,6 +883,15 @@ def get(self): """ path = 'api/tournament' return self._r.get(path, converter=models.Tournaments.convert_values) + + def get_tournament(self, tournament_id, page=1): + """Get information about a tournament. + :patam str tournament_id + :return: tournament information + :rtype: dict + """ + path = f'api/tournament/{tournament_id}?page={page}' + return self._r.get(path, converter=models.Tournaments.convert_values) @deprecated(version='0.11.0', reason='use Tournaments.create_arena or Tournaments.create_swiss instead') def create(self, clock_time, clock_increment, minutes, name=None, From 642db766e04191037428fcbbb252a50ca4faa6d8 Mon Sep 17 00:00:00 2001 From: Sam Ezeh Date: Fri, 9 Apr 2021 22:26:53 +0100 Subject: [PATCH 2/2] Update README.rst --- README.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/README.rst b/README.rst index 337688a..29d4d89 100644 --- a/README.rst +++ b/README.rst @@ -124,6 +124,7 @@ Most if not all of the API is available: client.bots.decline_challenge client.tournaments.get + client.tournaments.get_tournament client.tournaments.create_arena client.tournaments.create_swiss client.tournaments.export_arena_games