From c3b993cfce7d443ed3533fefcc74c166d5434a67 Mon Sep 17 00:00:00 2001 From: jlevine18 Date: Wed, 19 Feb 2020 21:50:56 -0600 Subject: [PATCH] tba_match_result_request.py v0.0.1 --- data analysis/tba_match_result_request.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 data analysis/tba_match_result_request.py diff --git a/data analysis/tba_match_result_request.py b/data analysis/tba_match_result_request.py new file mode 100644 index 00000000..209452bf --- /dev/null +++ b/data analysis/tba_match_result_request.py @@ -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