# add the handlers to the logger logger.addHandler(fh) logger.addHandler(ch) """ 2. Run searches from xls file """ docpath = "/home/dcfehder/Dropbox/projects/cit-tools/docs/ohchan-pubquery-3.xls" alist = xlsList(docpath, "wosSearch") #Since there is only one column of data, it will be in the second place in the list wosSearches = alist[1] wosSearchesSub = random.sample(wosSearches,900) #now run the searches #conn_path = '/home/dcfehder/dev/WoS.db' conn_path = '/home/dcfehder/Dropbox/projects/cit-tools/WoS-MITFac.db' outcome = wosAPI.search(wosSearchesSub, conn_path, 0.632, 20000) logger.info(outcome) """ 3. Log added rows of data """
c.execute(sqlcmd2) sqlcmd3 = 'CREATE TABLE wosSearch (search text PRIMARY KEY ASC, results text)' c.execute(sqlcmd3) sqlcmd4 = 'CREATE TABLE citedBy (UT text PRIMARY KEY ASC, forwCites text)' c.execute(sqlcmd4) sqlcmd5 = 'CREATE TABLE cites (UT text PRIMARY KEY ASC, cites text)' c.execute(sqlcmd5) sqlcmd6 = 'CREATE TABLE utRegister (UT text PRIMARY KEY ASC, article text, article_short text, wosSearch text, citedBy text, cites text)' c.execute(sqlcmd6) #close it all up conn.commit() c.close() #now I want to load some data into the database #first I create the list object pp = "/home/dcfehder/Dropbox/projects/cit-tools/nbtest.xls" aa = xls_util.xlsList(pp, "UT", "AU", "TI", "SO", "PD", "PY", "DI", "AF", "LA", "DT", "DE", "ID", "AB", "C1", "RP", "EM", "FU", "FX", "CR", "NR", "TC", "PU", "WC", "SC") xls_util.listInsTable(conn_path, 'article', aa)
c.execute(sqlcmd3) sqlcmd4 = 'CREATE TABLE citedBy (UT text PRIMARY KEY ASC, forwCites text)' c.execute(sqlcmd4) sqlcmd5 = 'CREATE TABLE cites (UT text PRIMARY KEY ASC, cites text)' c.execute(sqlcmd5) sqlcmd6 = 'CREATE TABLE utRegister (UT text PRIMARY KEY ASC, article text, article_short text, wosSearch text, citedBy text, cites text)' c.execute(sqlcmd6) #close it all up conn.commit() c.close() #now I want to load some data into the database #first I create the list object pp = "/home/dcfehder/Dropbox/projects/cit-tools/nbtest.xls" aa = xls_util.xlsList(pp, "UT", "AU", "TI", "SO", "PD", "PY", "DI", "AF", "LA", "DT", "DE", "ID", "AB", "C1", "RP", "EM", "FU", "FX", "CR", "NR", "TC", "PU", "WC", "SC") xls_util.listInsTable(conn_path, 'article', aa)
formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s') fh.setFormatter(formatter) ch.setFormatter(formatter) # add the handlers to the logger logger.addHandler(fh) logger.addHandler(ch) """ 2. Run searches from xls file """ docpath = "/home/dcfehder/Dropbox/projects/cit-tools/docs/ohchan-pubquery-3.xls" alist = xlsList(docpath, "wosSearch") #Since there is only one column of data, it will be in the second place in the list wosSearches = alist[1] wosSearchesSub = random.sample(wosSearches, 900) #now run the searches #conn_path = '/home/dcfehder/dev/WoS.db' conn_path = '/home/dcfehder/Dropbox/projects/cit-tools/WoS-MITFac.db' outcome = wosAPI.search(wosSearchesSub, conn_path, 0.632, 20000) logger.info(outcome) """ 3. Log added rows of data """