-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-analysis.py
64 lines (44 loc) · 1.71 KB
/
run-analysis.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
57
58
59
60
61
62
63
64
###################################
# run-analysis.py
###################################
"""
Author: Matt Balshaw
Start Date: 10/06/2020
Runs the analysis on a set of Facebook Messenger data using a specified config
"""
import json
import shutil
import os
from scripts.unzipper import ZipFuncs
from scripts.processor import ProcessorFuncs
from scripts.topcontactdetails import TopContactDetails
from scripts.messagesovertime import MessagesOverTime
if __name__ == "__main__":
print("====================================")
print("⛏ Starting the Messenger Analysis")
print("====================================")
# Do example config thing...
if not os.path.exists('config.json'):
print("Loading Example Config into Config")
shutil.copy('exampleconfig.json', 'config.json')
with open('config.json', 'r') as f:
config = json.load(f)
if config['debug']:
print("⚠ Debugging... will force re-run all processing")
print("##############################")
print("# Unzipping Data")
print("##############################")
ZipFuncs().run_unzip_process(config)
print("##############################")
print("# Processing Data")
print("##############################")
ProcessorFuncs().run_processing(config)
print("##############################")
print("# Generating Graphs")
print("##############################")
TopContactDetails().generate_all_graphs(config)
messagesOverTimeConfig = config['messagesOverTime']
MessagesOverTime().make_graphs(config, messagesOverTimeConfig)
print("====================================")
print("✓ Messenger Analysis Complete")
print("====================================")