pyETT package¶
Submodules¶
pyETT.ett module¶
-
class
pyETT.ett.
Cohort
(players)[source]¶ Bases:
object
A Class to represent a cohort of players
-
describe
() → pandas.core.frame.DataFrame[source]¶ Returns a dataframe with descriptive statistics of the players in the cohort considering only matches among themselves, such as win, losses and win rate. Additional player specific attributes are added to the dataframe, such as name, elo and rank.
- Returns
Players matchup stats in the cohort.
- Return type
pd.DataFrame
-
get_matches
(unranked: bool = False) → List[pyETT.ett.Match][source]¶ Returns matches among players in the cohort
-
-
class
pyETT.ett.
ETT
[source]¶ Bases:
object
A class to represent Eleven Table Tennis (ETT).
-
get_leaderboard
(num_players=10) → List[pyETT.ett.Player][source]¶ Returns a list of players from the leaderboard.
-
get_leaderboard_dataframe
(num_players: int = 10) → pandas.core.frame.DataFrame[source]¶ Returns a pandas dataframe with players from the leaderboard.
-
user_search
(username, perfect_match=False) → List[pyETT.ett.Player][source]¶ Returns a list of players whose name contains username, if perfect_match is False. Otherwise, it returns a list of players whose usernames is a perfect match with username.
-
-
class
pyETT.ett.
Player
(user_id, player=None, legacy_api=False)[source]¶ Bases:
object
A class to represent a Player.
-
AWAY
= 1¶
-
HOME
= 0¶
-
get_friends
() → List[pyETT.ett.Player][source]¶ Return a player’s friends list
-
get_friends_dataframe
() → pandas.core.frame.DataFrame[source]¶ Return a player’s friends list in a dataframe
-
get_matches
(unranked: bool = False) → List[pyETT.ett.Match][source]¶ Return player’s matches.
-
-
class
pyETT.ett.
Tournament
(players)[source]¶ Bases:
object
A Class to handle ETT official tournaments
-
qualify
(elo_min: float, start: str, end: str) → pandas.core.frame.DataFrame[source]¶ Implements logic to enter or qualify to ETT’s official monthly tournament. Players with an Elo rating exceeding
elo_min
at any point betweenstart
andend
date have direct entry to the tournament. Otherwise, they can enter a Qualifying Tournament to try and qualify. This method returns a dataframe indicating which players have direct entry or can qualify.- Parameters
elo_min (float) – Elo threshold to have direct entry to the Tournament.
start (str) – Start date (YYYY-MM-DD)
end (str) – End date (YYYY-MM-DD)
- Returns
- Data frame of players with the following information:
mean: Player’s mean Elo between
start
andend
min: Player’s min Elo between
start
and end`max: Player’s max Elo between
start
and end`direct_entry: Boolean indicating whether player have direct entry to the Tournament
can_qualify: Boolean indicating whether player can enter Qualifying Tournament
id: Player’s id
name: Player’s username
- Return type
pd.DataFrame
-
-
pyETT.ett.
official_tournament_leaderboard_dataframe
() → pandas.core.frame.DataFrame[source]¶ Returns a pandas dataframe with the leaderboard of the Eleven official tournaments available at http://lavadesignstudio.co.uk/eleven-rankings/.