|
| 1 | +# Usage Guide |
| 2 | + |
| 3 | +This quickstart assumes you know how to use AsyncIO and write asynchronous code in Python. |
| 4 | + |
| 5 | +## [Getting Player Info](../References/client.md#sendou.client.Client.get_tournament) |
| 6 | + |
| 7 | +```python |
| 8 | +from sendou import Client |
| 9 | +client = Client("API_KEY") |
| 10 | +player = await client.get_user("USER_ID") |
| 11 | +``` |
| 12 | + |
| 13 | +## [Getting Calendar Entries](../References/client.md#sendou.client.Client.get_calendar) |
| 14 | + |
| 15 | +```python |
| 16 | +from sendou import Client |
| 17 | +client = Client("API_KEY") |
| 18 | +tournament = await client.get_calendar("2023", "5") |
| 19 | +``` |
| 20 | + |
| 21 | + |
| 22 | +## [Getting Tournament Info](../References/client.md#sendou.client.Client.get_tournament) |
| 23 | + |
| 24 | +```python |
| 25 | +from sendou import Client |
| 26 | +client = Client("API_KEY") |
| 27 | +tournament = await client.get_tournament("TOURNAMENT_ID") |
| 28 | +``` |
| 29 | + |
| 30 | +### [Getting Tournament Teams](../References/models/tournament/tournament.md#sendou.models.tournament.tournament.Tournament.get_teams) |
| 31 | + |
| 32 | +```python |
| 33 | +from sendou import Client |
| 34 | +client = Client("API_KEY") |
| 35 | +tournament = await client.get_tournament("TOURNAMENT_ID") |
| 36 | +teams = await tournament.get_teams() |
| 37 | +``` |
| 38 | + |
| 39 | +### [Get Player from Team member](../References/models/tournament/team.md#sendou.models.tournament.team.TeamMember.get_user) |
| 40 | + |
| 41 | +```python |
| 42 | +from sendou import Client |
| 43 | +client = Client("API_KEY") |
| 44 | +tournament = await client.get_tournament("TOURNAMENT_ID") |
| 45 | +teams = await tournament.get_teams() |
| 46 | +for team in teams: |
| 47 | + for member in team.members: |
| 48 | + player = await member.get_player() |
| 49 | +``` |
| 50 | + |
| 51 | +### [Getting Tournament Bracket(s)](../References/models/tournament/tournament.md#sendou.models.tournament.tournament.TournamentBracket.get_bracket_data) |
| 52 | + |
| 53 | +```python |
| 54 | +from sendou import Client |
| 55 | +client = Client("API_KEY") |
| 56 | +tournament = await client.get_tournament("TOURNAMENT_ID") |
| 57 | +for bracket in tournament.brackets: |
| 58 | + bracket_data = await bracket.get_data() |
| 59 | +``` |
| 60 | + |
| 61 | +## [Getting Tournament Match Info](../References/client.md#sendou.client.Client.get_tournament_matches) |
| 62 | +**Note:** This is not linked to the bracket. You need to know the match ID. |
| 63 | + |
| 64 | +(*This will be updated in future when documentation is updated*) |
| 65 | + |
| 66 | +```python |
| 67 | +from sendou import Client |
| 68 | +client = Client("API_KEY") |
| 69 | +match = await client.get_tournament_matches("Match_ID") |
| 70 | +``` |
0 commit comments