Reputation: 101
I'm trying to get the holiday name passing the date in workalendar.europe library but I have no results
form workalendar.europe import France
cal._holidays.get(datetime.date(2015, 1, 1))
Upvotes: 2
Views: 1947
Reputation: 368894
Using workalendar.core.Calendar.holidays
which returns a list of (date, holiday)
pairs:
>>> import datetime
>>> from workalendar.europe import France
>>> cal = France()
>>> d = datetime.date(2015, 1, 1)
>>> holiday_map = dict(cal.holidays(d.year)) # list -> dict
>>> holiday_map.get(d, '?')
'New year'
Upvotes: 1