Messy Date Formatting
Formatting dates

Simpler way to produce your required the formats is using the strftime symbols, for example:

# yesterday's date in format ddmmyyyy (e.g. 08122016)
strDate = '{:%d%m%Y}'.format(d - timedelta(1))

# yesterday's date in format yymmdd (e.g 161208)
DateStr = '{:%y%m%d}'.format(d - timedelta(1))


Formattings dates to use in filenames

I would strongly discourage using any of these formats in filenames.
Consider adopting the yyyymmdd format instead.
The good thing about this format is that the alphabetic ordering is the same as chronological ordering,
which is often very practical.

String conversions

The format function of a string returns a string.
So the second line here is unnecessary:


strDate = '{d.year}{d.month:02}{d.day:02}'.format(d=datetime.datetime.now()- timedelta(1))
strDate = str(strDate)



String concatenation

String concatenation like this is not recommended:


fpath = strDate + "_" + str(day)  + "_" +  str(week) + ".zip"



Better use the format function:

fpath = '{}_{}_{}.zip'.format(strDate, day, week)


Other Python conventions

The strDate and DateStr variable names go against the recommended naming convention.
I suggest to read PEP8, it explains this and other recommendations to follow.