-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_cached_data.py
More file actions
31 lines (25 loc) · 884 Bytes
/
check_cached_data.py
File metadata and controls
31 lines (25 loc) · 884 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
import os
import time
from caching import Caching
from parser_1 import Parser
import firebase_admin
from firebase_admin import credentials
def main():
try:
cred = credentials.Certificate("config/firebase.json")
firebase_admin.initialize_app(cred)
except:
print('Please put the creds in the config folder and rename it to "firebas.json"')
files = [f for f in os.listdir("csv/") if os.path.isfile(os.path.join("csv/", f))]
csv_files = []
for f in files:
if f.endswith("csv"):
csv_files.append(f)
for f in csv_files:
count = Caching.checkIfCachingExist(f)
if count != -1:
print("Cached data found in {}, upload process of cached data will start in 10 sec".format(f))
time.sleep(10)
Parser.parseCached("csv/"+f, count)
if __name__=="__main__":
main()