Created
February 16, 2022 14:20
-
-
Save databyjp/e7db42a9cabcf25da90f9cddc525a934 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def update_box_scores(box_json_dir="dl_data/box_scores/json"): | |
""" | |
Download all box scores from NBA API | |
:param box_json_dir: Directory to save downloads to | |
:return: | |
""" | |
logger.info("Starting download of game box scores...") | |
gldf = utils.load_gamelogs() | |
gldf = gldf.sort_values("gamedate_dt") | |
gm_ids = gldf["Game_ID"].unique() | |
for gm_id in gm_ids[::-1]: | |
fetch_box_score(box_json_dir, gm_id) | |
logger.info("Finished downloading game box scores...") | |
return True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment