mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-10 06:54:44 +00:00
Merge branch 'master' of https://github.com/titanscout2022/tr2022-strategy
This commit is contained in:
commit
a2df09dec0
11
data analysis/tba_match_result_request.py
Normal file
11
data analysis/tba_match_result_request.py
Normal file
@ -0,0 +1,11 @@
|
||||
import requests
|
||||
def req_event_matches(eventkey,apikey):
|
||||
headers={'X-TBA-Auth-Key':apikey}
|
||||
r=requests.get('https://www.thebluealliance.com/api/v3/event/'+eventkey+'/matches/simple', headers=headers)
|
||||
return r
|
||||
def sort_through_request(request)
|
||||
if request.status_code = 200
|
||||
x=[]
|
||||
for i in sorted(request.json(), key=lambda i: i['actual_time']):
|
||||
x.append([[i['alliances']['red']['team_keys'], i['alliances']['blue']['team_keys']],i['winning_alliance']])
|
||||
return x
|
Loading…
Reference in New Issue
Block a user