US Federal Holidays 2017

import re from datetime import datetime from pandas.tseries.holiday import get_calendar, USFederalHolidayCalendar pattern = re.compile(r"(?<=Holiday:\s).*?(?=\s\()") from_day, to_day = datetime(2016, 12, 31), datetime(2017, 12, 31) cal = get_calendar('USFederalHolidayCalendar') for date, rule in zip(cal.holidays(from_day, to_day), cal.rules): day_name = pattern.search(str(rule)).group(0) print('{0}: {1}'.format(date.strftime('%d.%m.%Y'), day_name)) """ 02.01.2017: New Years Day 16.01.2017: Dr. Martin Luther King Jr. 20.02.2017: Presidents Day 29.05.2017: MemorialDay 04.07.2017: July 4th 04.09.2017: Labor Day 09.10.2017: Columbus Day 10.11.2017: Veterans Day 23.11.2017: Thanksgiving 25.12.2017: Christmas """