add ability to load manual JSON for metrics

This commit is contained in:
Dev 2022-03-24 16:19:47 -05:00
parent 8908f05cbe
commit ef63c1de7e

View File

@ -1,6 +1,7 @@
import requests
import pull
import pandas as pd
import json
def pull_new_tba_matches(apikey, competition, cutoff):
api_key= apikey
@ -11,6 +12,12 @@ def pull_new_tba_matches(apikey, competition, cutoff):
out.append({"match" : i['match_number'], "blue" : list(map(lambda x: int(x[3:]), i['alliances']['blue']['team_keys'])), "red" : list(map(lambda x: int(x[3:]), i['alliances']['red']['team_keys'])), "winner": i["winning_alliance"]})
return out
def pull_new_tba_matches_manual(apikey, competition, cutoff):
filename = competition+"-wins.json"
with open(filename, 'r') as f:
data = json.load(f)
return data
def get_team_match_data(client, competition, team_num):
db = client.data_scouting
mdata = db.matchdata