forked from natanelia/arkintel-crawler
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformatProcessor.py
More file actions
executable file
·34 lines (25 loc) · 859 Bytes
/
Copy pathformatProcessor.py
File metadata and controls
executable file
·34 lines (25 loc) · 859 Bytes
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
#!/usr/bin/env python3
__author__ = 'Natan Elia'
import sys, os
sys.path.append(os.path.abspath('src'))
import IntelProcessor
import Util
import time
def main(argv):
if (len(argv) <= 0):
Util.printErr("You have not specified any json filename.")
Util.printErr("Write something like this: python3 formatProcessor.py <input filename> [output filename]")
return
Util.printProcess('Reading JSON')
jsonData = Util.readJSONFile(argv[0])
print(jsonData['count'], 'data will be processed.')
fileOut = None
if len(argv) > 1:
fileOut = argv[1]
else:
fileOut = input('Save CSV filename: ')
Util.printProcess('Converting to CSV...')
startTime = time.time()
IntelProcessor.mapToCSV(jsonData, fileOut)
print('Success! {:f} secs'.format(time.time() - startTime))
main(sys.argv[1:])