摘要:
import xlrdfrom DataCleaning.library.functions.changeDirectory import *# read and return .xlfx/.XLFX file with file name: fnamedef readXlsxFile(fname, 阅读全文
摘要:
import pymssqlimport loggingimport mathimport datetimefrom DataCleaning.library.functions.processBar import *def list2SQL(cursor, list0, tempTableName 阅读全文
摘要:
import osimport loggingimport datetimefrom DataCleaning.library.functions.appendString2Txt import *from DataCleaning.library.functions.createTxt impor 阅读全文
摘要:
import jsonfrom collections import namedtupledef json2Object(jsonObj): return json.loads(jsonObj, object_hook=lambda d: namedtuple('jsonMain', d.keys( 阅读全文
摘要:
# input: xlrd.book.Book# output: two sheetsdef getTwoSheets(bk): return bk.sheets()[0], bk.sheets()[1] 阅读全文
摘要:
import loggingimport os# from DataCleaning.library.functions.changeDirectory import *from DataCleaning.library.config.config import LOG_FORMAT, DATE_F 阅读全文
摘要:
# from DataCleaning.library.functions.getLatestFileName import *# getLatestFileName(keyWord, fileNames, sep = "_", comparePath = "")from DataCleaning. 阅读全文
摘要:
import pymssqlimport loggingfrom DataCleaning.library.functions.getFileNames import *from DataCleaning.library.functions.readXlsxFile import *from Dat 阅读全文
摘要:
import datetimeimport xlrddef excelDateFormatter(sh, i, j, sep = "-"): if sh.cell(i, j).ctype == 3: cell = sh.cell_value(i, j) date = datetime.datetim 阅读全文
摘要:
from DataCleaning.library.functions.floatFormatter import *from DataCleaning.library.functions.list2SQL import *from DataCleaning.library.functions.ex 阅读全文
摘要:
from DataCleaning.library.functions.changeDirectory import *def createTxt(string, target, targetPath = ""): tempWD = os.getcwd() if targetPath != "": 阅读全文
摘要:
# load all packages with necessary functionsimport osimport sysimport datetimeimport loggingimport gcfrom DataCleaning.library.functions.initLogConfig 阅读全文
摘要:
import pymssqlimport loggingdef createCursor(serverAddress, userName, password, dataBase): # create connection and cursor conn = pymssql.connect(serve 阅读全文
摘要:
import csvimport loggingfrom DataCleaning.library.functions.changeDirectory import *from floatFormatter import *from DataCleaning.library.functions.ad 阅读全文
摘要:
import shutilfrom DataCleaning.library.functions.changeDirectory import *import loggingimport datetimedef copy2Output(outputFileName, storagePath, tar 阅读全文
摘要:
import logging# returns corresponding tempAbbr, tempStdCountryName, tempGEO for given countryNamedef citySearcher(cityName, citySearcherDic): cityName 阅读全文
摘要:
import os# change the current working directory from 'project\src\development' to 'project\volume\data\external'def development2External(naming = ""): 阅读全文
摘要:
def addRow(row, strLines, sep = "|"): strTemp = "" for i in range(len(row)): strTemp += row[i].replace(sep, " ") + sep return strLines + strTemp[:-1] 阅读全文
摘要:
from DataCleaning.library.functions.changeDirectory import *def appendString2Txt(string, target, targetPath = ""): tempWD = os.getcwd() if targetPath 阅读全文
摘要:
import osimport sys# add path to lib envdef addPath(target, scriptPath): ## Add path 'project\src\target' to system path os.chdir(scriptPath) # change 阅读全文