aboutsummaryrefslogtreecommitdiffstats
path: root/python/externalmarksbackfill.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/externalmarksbackfill.py')
-rw-r--r--python/externalmarksbackfill.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/python/externalmarksbackfill.py b/python/externalmarksbackfill.py
index 64c8c81e..73c56756 100644
--- a/python/externalmarksbackfill.py
+++ b/python/externalmarksbackfill.py
@@ -10,7 +10,7 @@ from pickle import dumps
from sqlalchemy import create_engine
from itertools import chain
from glob import glob, iglob
-from pandas.tseries.offsets import MonthEnd
+from pandas.tseries.offsets import MonthEnd, BDay
def runAllFill():
for f in get_globs():
@@ -20,7 +20,8 @@ def runAllFill():
def runSingleFill(f):
range_name, sheet_name, done = settings[os.path.basename(f)]
- markdate = pd.Timestamp(os.path.dirname(f).rsplit(os.path.sep, 1)[-1]) + MonthEnd()
+ markdate = pd.Timestamp(os.path.dirname(f).rsplit(os.path.sep, 1)[-1])-5*BDay() + MonthEnd()
+ #change /usr/lib/python3.6/site-packages/xlrd/xlsx.py line 609 to check for ":" in ref as well. Otherwise single merged cells bombs
marks = pd.read_excel(f, sheet_name, skiprows=13, parse_cols=range_name)
df = pd.DataFrame()
@@ -96,6 +97,10 @@ def get_globs():
return chain.from_iterable(globs)
settings = {
+ 'ReviewedPack.bseeman.SERENITAS.SERCGMAST.20170501.20170531.Draft.xlsx': ("JA:JX", "Securities Valuation Details", "N"),
+ 'ReviewedPack.bseeman.SERENITAS.SERCGMAST.20170401.20170430.Draft.xlsx': ("JA:JX", "Securities Valuation Details", "Y"),
+ 'ReviewedPack.bseeman.SERENITAS.SERCGMAST.20170301.20170331.Draft.xlsx': ("JA:JX", "Securities Valuation Details", "Y"),
+ 'ReviewedPack.bseeman.SERENITAS.SERCGMAST.20170201.20170228.Draft.xlsx': ("JA:JX", "Securities Valuation Details", "Y"),
'ReviewedPack.bseeman.SERENITAS.SERCGMAST.20170101.20170131.Draft.xlsx': ("JA:JX", "Securities Valuation Details", "Y"),
'ReviewedPack.bseeman.SERENITAS.SERCGMAST.20161201.20161231.Draft.xlsx': ("JA:JX", "Securities Valuation Details", "Y"),
'ReviewedPack.bseeman.SERENITAS.SERCGMAST.20161101.20161130.Draft.xlsx': ("JA:JX", "Securities Valuation Details", "Y"),