-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
executable file
·54 lines (41 loc) · 1.31 KB
/
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
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
#!/usr/bin/env python3
#######################################################################
# Author(s): D. Knowles
# Date: 30 Aug 2019
# Desc: Github Traffic Tool
#######################################################################
import os
import configparser
from lib.plotter import Plotter
from lib.analytics import Analytics
from lib.email_sender import EmailSender
from lib.traffic_requester import TrafficRequester
def main():
# main options
save_plots = True
verbose = True
# read configuration file
config = configparser.ConfigParser()
file_dir = os.path.dirname(os.path.realpath(__file__))
config_path = file_dir + "/config/settings_standard.ini"
prefix = "settings_standard"
config.read(config_path)
# create instance of traffic requester
tr = TrafficRequester(config,prefix,verbose)
# run traffic requester
tr.run()
# create instance of analytics
an = Analytics(prefix,verbose)
# run analytics
an.run()
# create instance of email sender
es = EmailSender(config,prefix,verbose)
# send email
es.run()
# create and show plots if requested
if save_plots:
pl = Plotter(prefix)
# create a bunch of plots as desired
pl.create_plots(verbose)
if __name__ == "__main__":
main()