-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_ReadMuseumJSON.py
67 lines (53 loc) · 2.01 KB
/
1_ReadMuseumJSON.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
65
66
67
#########################################################
#### Written By: SATYAKI DE ####
#### Written On: 27-Jun-2023 ####
#### Modified On 28-Sep-2023 ####
#### ####
#### Objective: This is the main calling ####
#### python script that will invoke the ####
#### Musuem API & create the hsitorical data. ####
#### ####
#########################################################
import datetime
from clsConfigClient import clsConfigClient as cf
import clsExtractJSON as cej
########################################################
################ Global Area ######################
########################################################
cJSON = cej.clsExtractJSON()
basePath = cf.conf['DATA_PATH']
outputPath = cf.conf['OUTPUT_PATH']
mergedFile = cf.conf['MERGED_FILE']
########################################################
################ End Of Global Area #################
########################################################
# Disbling Warning
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
def main():
try:
var = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
print('*'*120)
print('Start Time: ' + str(var))
print('*'*120)
inputFileName = 'mergedFile.csv'
subdir = 'output'
r1 = cJSON.genData()
#r1 = cJSON.mergeCsvFilesInDirectory(basePath, outputPath, mergedFile)
#r1 = cJSON.cleanDB(inputFileName, subdir)
if r1 == 0:
print()
print('Successfully Scrapped!')
else:
print()
print('Failed to Scrappe!')
print('*'*120)
var1 = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
print('End Time: ' + str(var1))
except Exception as e:
x = str(e)
print('Error: ', x)
if __name__ == '__main__':
main()