new JJSV templates & walmart script is being annoying
This commit is contained in:
@ -8,7 +8,7 @@ import pandas as pd
|
||||
|
||||
rootdir = "/Users/normrasmussen/Documents/Resources/Walmart/"
|
||||
downloadir = "/Users/normrasmussen/Google Drive/My Drive/Shared with Clients/Walmart/"
|
||||
basefile = "WalmartBase.xlsx"
|
||||
basefile = "WalmartTemplate.xlsx"
|
||||
|
||||
def copytemplate(rootdir, basefile):
|
||||
today = date.today()
|
||||
@ -24,13 +24,19 @@ def copytemplate(rootdir, basefile):
|
||||
findlatestExport(currentDash)
|
||||
|
||||
def findlatestExport(currentDash):
|
||||
listfiles = glob.glob(downloadir + '*.xlsx')
|
||||
listfiles = glob.glob(downloadir + '*.csv')
|
||||
latestdownload = max(listfiles, key=os.path.getctime)
|
||||
print(latestdownload)
|
||||
copytoDash(latestdownload, currentDash)
|
||||
|
||||
def copytoDash(latestdownload, currentDash):
|
||||
readExport = pd.read_excel(latestdownload, index_col=False)
|
||||
readExport = pd.read_csv(
|
||||
latestdownload,
|
||||
index_col=False,
|
||||
header=0,
|
||||
dtype={
|
||||
'Progress':int
|
||||
})
|
||||
print(readExport)
|
||||
readExport.drop(
|
||||
readExport.filter(
|
||||
@ -50,6 +56,7 @@ def bringtoExcel(latestdownload, currentDash, copiedData):
|
||||
) as writer:
|
||||
copiedData.to_excel(
|
||||
writer,
|
||||
engine="xlsxwriter",
|
||||
sheet_name="Data",
|
||||
index=False,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user