def main(): url = "https://nhlstatisticsforohtu.herokuapp.com/players.txt" reader = PlayerReader(url) stats = Statistics(reader) query = QueryBuilder() #matcher = query.playsIn("NYR").build() #matcher = query.build() matcher = ( query .oneOf( query.playsIn("PHI") .hasAtLeast(10, "assists") .hasFewerThan(5, "goals") .build(), query.playsIn("EDM") .hasAtLeast(40, "points") .build() ) .build() ) for player in stats.matches(matcher): print(player)
def main(): url = "https://nhlstatisticsforohtu.herokuapp.com/players" reader = PlayerReader(url) stats = PlayerStats(reader) players = stats.top_scorers_by_nationality("FIN") for player in players: print(player)
def main(): url = "https://nhlstatisticsforohtu.herokuapp.com/players.txt" reader = PlayerReader(url) stats = Statistics(reader) matcher = And(HasAtLeast(5, "goals"), HasAtLeast(5, "assists"), PlaysIn("PHI")) for player in stats.matches(matcher): print(player)
def main(): url = "https://nhlstatisticsforohtu.herokuapp.com/players" reader = PlayerReader(url) stats = PlayerStats(reader) players = stats.top_scorers_by_nationality("FIN") print("Players from FIN " + str(datetime.now()) + "\n") for player in players: print(player)
def main(verbose=False): url = "https://nhlstatisticsforohtu.herokuapp.com/players" reader = PlayerReader(url) stats = PlayerStats(reader) nationality = "FIN" now = datetime.now() print(f"Players from {nationality} {now}") players = stats.top_scorers_by_nationality(nationality) for player in players: print(player)
def main(): stats = Statistics(PlayerReader("https://nhlstatisticsforohtu.herokuapp.com/players.txt")) philadelphia_flyers_players = stats.team("PHI") top_scorers = stats.top_scorers(10) print("Philadelphia Flyers:") for player in philadelphia_flyers_players: print(player) print("Top scorers:") for player in top_scorers: print(player)
def main(): url = "https://nhlstatisticsforohtu.herokuapp.com/players.txt" reader = PlayerReader(url) stats = Statistics(reader) #matcher = And( # HasAtLeast(5, "goals"), # HasAtLeast(5, "assists"), # PlaysIn("PHI") #) query = QueryBuilder() matcher = query.playsIn("NYR").hasAtLeast(5, "goals").build() # #print(typeof(matcher)) for player in stats.matches(matcher): print(player)
def __init__(self): reader = PlayerReader( "https://nhlstatisticsforohtu.herokuapp.com/players.txt" ) self._players = reader.get_players()
def __init__(self, reader: PlayerReader): self.players = reader.get_players()