mirror of
https://github.com/titanscouting/tra-superscript.git
synced 2024-12-28 10:39:09 +00:00
add ability to load manual JSON for metrics
This commit is contained in:
parent
8908f05cbe
commit
ef63c1de7e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user