예제 #1
0
def get_plays(year):
    """
    Scrape the standard plays for given year
    :param year: year to scrape
    :return: yields dicts for each play
    """
    for week in range(1, 18):
        w = Week(year, week)
        for game_id in w.get_game_ids():
            p = PlayByPlay(game_id)
            for play_datum in p.get_play_data():
                yield play_datum
        logger.info("Completed week {0}".format(week))