File size: 361 Bytes
a18e058
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
try:
    import jpholiday as _jpholiday
    def is_holiday(d) -> bool:
        return bool(_jpholiday.is_holiday(d))
except ImportError:
    def is_holiday(d) -> bool:
        return False


def holiday_set(dates) -> set:
    """日付のイテラブルから祝日のISO文字列セットを返す"""
    return {d.isoformat() for d in dates if is_holiday(d)}