''' # main functon to run ''' #%% from datetime import datetime from appConfig import getConfig from read_angle_file import read_angle_data from insert_angle_data import push_data_to_DB import pandas as pd # test the function for usage angleFolder, connStr = getConfig('angleFolder', 'connStr') print("angle in index file: {0}".format(angleFolder)) print(connStr) #%% # call the function for reading the excel file data df1, df2 = read_angle_data(angleFolder) # %% # push wide angle data push_data_to_DB(df1, connStr) # push adjacent angle record push_data_to_DB(df2, connStr) # %%
#%% from datetime import datetime from appConfig import getConfig from xcel_read import read_xcl import pandas as pd # test the function for usage angle = getConfig('angleFolder') print("angle in index file: {0}".format(angle)) '''temp_list= angle.split('_')[2:] temp_list[-1]=temp_list[-1].split('.')[0] dat='-'.join(temp_list) print(dat)''' #%% # call the function for reading the excel file data df1, df2 = read_xcl(angle) #df_adj= read_xcl(angle) # %%
# %% import pandas as pd from appConfig import getConfig from insert_violation_data import pushViolationData #%% #df = pd.read_excel('Significant Violation of IEGC.xlsx') violationData, connStr = getConfig('violationData', 'connStr') df = pd.read_excel(violationData) print(violationData) # %% # get the cells from 9 to 13 row indexes but all columns count = 0 data = pd.DataFrame() print(type(data)) for i in range(df.shape[0]): dfSubset = df.iloc[i:i + 1, :] #print("row= {0}".format(i)) df1 = dfSubset[[ 'Message no.', 'Date', 'Entity1', 'Schedule1', 'Drawal1', 'Deviation1' ]] if not (pd.isnull(dfSubset['Entity2'].iloc[0])): #print("value present") df2 = dfSubset[[ 'Message no.', 'Date', 'Entity2', 'Schedule2', 'Drawal2', 'Deviation2' ]] df2.rename(columns={'Entity2': 'Entity1'}, inplace=True) df2.rename(columns={'Schedule2': 'Schedule1'}, inplace=True) df2.rename(columns={'Drawal2': 'Drawal1'}, inplace=True)
from utils.nodeStatusFetcher import fetchNodeStatus from appConfig import getConfig import pandas as pd import sys import datetime as dt import requests from utils.idSrvUtils import getAccessTokenFromSts appConfig = getConfig() # read the nodes info nodesInfoPath = appConfig["nodesExcelPath"] nodesDf = pd.read_excel(nodesInfoPath, engine='openpyxl') ipCol = 'ip' nameCol = 'name' if (ipCol not in nodesDf) or (len(nodesDf[ipCol]) == 0): sys.exit('IPs not present or not found in nodes.xlsx file...') if (nameCol not in nodesDf) or (len(nodesDf[nameCol]) == 0): sys.exit('Names not present or not found in nodes.xlsx file...') # remove duplicate rows based on the name and ip columns nodesDf = nodesDf.drop_duplicates(subset=nameCol, keep="first") nodesDf = nodesDf.drop_duplicates(subset=ipCol, keep="first") statusList = [] for nRow in range(nodesDf.shape[0]): nIp = nodesDf[ipCol].iloc[nRow] nName = nodesDf[nameCol].iloc[nRow]
import io, os from speechToText import startSpeechDetector from appConfig import getConfig user_name = 'testing' input_language_code = 'en-us' language_code = 'en_au' gender = 'F' check_list = ['wallet', 'keys', 'phone', 'backpack'] # os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = r"GoogleVision.json" user_name, check_list, language_code, gender, address = getConfig() startSpeechDetector(user_name, check_list, language_code, gender, address)
# %% from appConfig import getConfig # test the function for usage print(getConfig('angleFolder')) # %%