tba_match_result_request.py v0.0.1

This commit is contained in:
jlevine18 2020-02-19 21:50:56 -06:00 committed by GitHub
parent 2cb5c54d8b
commit c3b993cfce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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