forked from schemes-ohyeah/tcs-overwatch-elo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTCS_Main.py
27 lines (22 loc) · 900 Bytes
/
TCS_Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from TCS_Functions import TCS_Functions as TCS
def main() -> None:
# Uncomment the following line to scrape
# Warning: takes a while
#scrape_teams_write_tojson()
teams = TCS.read_teams_from_json(reset=True)
matches = TCS.calculate_matches(teams)
future_matches = TCS.predict_matches(teams)
TCS.write_tojson(teams, "teams.json")
TCS.write_tojson(matches, "matches.json")
TCS.write_tojson(future_matches, "future_matches.json")
def scrape_teams_write_tojson() -> None:
"""
Running this will take half an hour as it scrapes all SR from Overbuff.
Only run this to update the json file from a web scrape
:return:
"""
# Create a dictionary of Team objects by scraping TCS and Overbuff
teams = TCS.get_teams()
# Save this data to a json file named teams.json
TCS.write_tojson(teams, "teams.json")
main()