def __init__(self, match_id, title, format, venue, result, match_link, winning_team, margin): self.__id = match_id self.__title = title self.__format = format self.__venue = venue self.__result = result self.__date = 0 # epoch time self.__winning_team = None self.__win_margin = margin # {'team_1_name' : 'team_1_short_name', 'team_2_name':'team_2_short_name'} self.__playing_teams = {} playing_teams = title.split(",")[0].split(" vs ") self.__playing_teams[playing_teams[0]] = playing_teams[0] self.__playing_teams[playing_teams[1]] = playing_teams[1] # India Women Red vs India Women Blue, India Red Won by 7 Wickets # https://www.cricbuzz.com/cricket-scores/20732 India Women Blue vs India Women Green, India Green Won by 7 # Wickets https://www.cricbuzz.com/cricket-scores/20733 if self.__result == 'WIN': self.__winning_team = Common.get_close_match(winning_team, playing_teams) self.__match_link = match_link self.__match_info = {} self.__match_squad = {} self.__innings_scores = [] self.__per_innings_head_to_head_data = [] self.__logger = logging.getLogger(__name__)
def __get_player_full_name_from_short_name(self, name): if name not in self.__short_name_to_full_name_map.keys(): close_match = Common.get_close_match(name, self.__local_squad.keys()) self.__short_name_to_full_name_map[name] = close_match return self.__short_name_to_full_name_map[name]