-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandballStats.py
56 lines (43 loc) · 1.85 KB
/
handballStats.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
from lib.scraperPlayerProgress import scrapePlayerProgress
from lib.scraperGameProgression import scrapeGameProgression
from lib.plotterGameProgression import plotGameProgressions
from datetime import datetime
import options
def handballStats():
"""Executes HandballStats according to settings in options.py"""
start = datetime.now()
print(f'initiating handballStats with the following parameters:')
#print(help(options))
# --------------------------------
# unfinished stuff
# print("\n", "-"*30, "\n", "Scraping Player Stats", "\n", "-"*30, "\n")
# scrapePlayerStats()
# print("\n", "-"*30, "\n", "Plotting Player Stats", "\n", "-"*30, "\n")
# plotPlayerStats()
# --------------------------------
if options.scrapePlayerProgress:
try:
print("\n", "-" * 30, "\n", "Scraping Player Progress", "\n", "-" * 30, "\n")
scrapePlayerProgress()
except Exception as e:
print(f"ERROR: Could not scrape PlayerProgress, exception: {e}")
if options.plotPlayerProgress:
print("\n", "-" * 30, "\n", "Plotting Player Progress", "\n", "-" * 30, "\n")
plotPlayerProgress()
if options.scrapeGameProgressions:
try:
print("\n", "-" * 30, "\n", "Scraping Game Progression", "\n", "-" * 30, "\n")
scrapeGameProgression()
except Exception as e:
print(f"ERROR: Could not scrape GameProgressions, exception: {e}")
print("If Exception was 'Kader', there might not be stats for this game")
if options.plotGameProgressions:
print("\n", "-" * 30, "\n", "Calculating Median Performance", "\n", "-" * 30, "\n")
plotGameProgressions()
end = datetime.now()
print()
print('#'*10)
print(f'done. elapsed time: {end - start}')
print('#' * 10)
if __name__ == '__main__':
handballStats()