Example #1
0
def main():
    logger = logCreate.getLogger(__name__, logSettings.mycomponent['logger'])
    hostname = readValue('hostname', section='mysql')
    database = readValue('database', section='mysql')
    username = readValue('username', section='mysql')
    password = readValue('password', section='mysql')
    tablename = readValue('sqltablename', section='mysql')

    flagdata = pd.read_excel("../data/FeatureLevelsFinal.xlsx")

    cur, cnx = sqlConnet(database, username, password, hostname, logger)
    safe_update1 = "set sql_safe_updates = 0;"
    safe_update2 = "set sql_safe_updates = 1;"
    try:
        cur.execute(safe_update1)
        sql1 = "ALTER TABLE {}.{} ADD Topic varchar(70);".format(
            database, tablename)
        cur.execute(sql1)
        cur.execute(safe_update1)
        sql2 = "ALTER TABLE {}.{} ADD SubTopic varchar(70);".format(
            database, tablename)
        cur.execute(sql2)
        cur.execute(safe_update1)
    except:
        pass
    predict = flagupdate(cur, cnx, database, tablename, flagdata)
Example #2
0
def main():
    logger = logCreate.getLogger(__name__, logSettings.mycomponent['logger'])
    hostname = readValue('hostname', section='mysql')
    database = readValue('database', section='mysql')
    username = readValue('username', section='mysql')
    password = readValue('password', section='mysql')
    tablename = readValue('sqltablename', section='mysql')
    cur, cnx = sqlConnet(database, username, password, hostname, logger)
    predict = add_features(logger, cur, cnx, database, tablename, hostname,
                           username, password)
def main():    
	logger =logCreate.getLogger(__name__,logSettings.mycomponent['logger']) 
	hostname = readValue('hostname',section='mysql')
	database = readValue('database',section='mysql')
	username = readValue('username',section='mysql')
	password = readValue('password',section='mysql')
	tablename = readValue('sqltablename',section='mysql')    
	cur,cnx = sqlConnet(database,username,password,hostname,logger)
	logger =logCreate.getLogger(__name__,logSettings.mycomponent['logger']) 
	df_new_feat=pd.read_excel('../data/FeatureLevelsFinal.xlsx')
	predict=predict_data(logger,df_new_feat,cur,cnx,database,tablename,hostname,username,password)
Example #4
0
def main():
    logger = logCreate.getLogger(__name__, logSettings.mycomponent['logger'])
    hostname = readValue('hostname', section='mysql')
    database = readValue('database', section='mysql')
    username = readValue('username', section='mysql')
    password = readValue('password', section='mysql')
    tablename = readValue('sqltablename', section='mysql')
    cur, cnx = sqlConnet(database, username, password, hostname, logger)

    df = pd.read_excel('../data/dbbackup/appreviewsAnalysis.xlsx')

    query = 'select count(*) from %s.%s;' % (database, tablename)

    cur = cnx.cursor()
    cur.execute(query)
    n = cur.fetchone()
    db_cnt = n[0]
    csv_cnt = df.shape[0]
    if db_cnt < csv_cnt:
        print("loading csv data to database")
        df_to_mysql(tablename, cur, cnx, database, username, password,
                    hostname, logger, df)
    else:
        print('already database has more records than csv')
Example #5
0
def main():
    hostname = readValue('hostname', section='mysql')
    database = readValue('database', section='mysql')
    username = readValue('username', section='mysql')
    password = readValue('password', section='mysql')
    tablename = readValue('sqltablename', section='mysql')

    tbcreate = readValue('cumulativetable', section='default')
    cur, cnx = sqlConnet(database, username, password, hostname)
    tablecreation = tableCreation(tbcreate, database, tablename, cur, cnx)
def main():
	hostname = readValue('hostname',section='mysql')
	database = readValue('database',section='mysql')
	username = readValue('username',section='mysql')
	password = readValue('password',section='mysql')
	tablename = readValue('sqltablename',section='mysql')

	dbBackup = readValue('backupfromdb',section='default')
	
	cur,cnx = sqlconnet(database,username,password,hostname) 
	fetchdata=histodataFetch(cur,cnx,dbBackup,tablename)
Example #7
0
def main():
    database = readValue('database', section='mysql')
    appInfo = applicationInfo(database)
def main():
    requirements =readValue('requirements',section='default')
    installed_packages= sys_installed_packages()
    install_packages=sys_install_packages(installed_packages,requirements)