def schedule_and_record(season=None, team=None): # retrieve html from baseball reference # sanatize input team = team.upper() try: if season < first_season_map[team]: m = "Season cannot be before first year of a team's existence" raise ValueError(m) # ignore validation if team isn't found in dictionary except KeyError: pass if season > datetime.now().year: raise ValueError('Season cannot be after current year') soup = get_soup(season, team) table = get_table(soup, team) table = process_win_streak(table) table = make_numeric(table) return table
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter