I would recommend using the dateutil library for such tasks. The main (not ignoring the holidays) iterator during business days, and then simply:
from dateutil.rrule import DAILY, rrule, MO, TU, WE, TH, FR def daterange(start_date, end_date): return rrule(DAILY, dtstart=start_date, until=end_date, byweekday=(MO,TU,WE,TH,FR))
earl
source share