Download utils/holidays.py from sdu-shift/app: direct link, hf CLI and curl.
- Browser
- Download file 361 Bytes
-
https://huggingface.co/spaces/sdu-shift/app/resolve/main/utils/holidays.py
- Command line
-
hf download hf://spaces/sdu-shift/app/utils/holidays.py
-
curl -L -o holidays.py https://huggingface.co/spaces/sdu-shift/app/resolve/main/utils/holidays.py
361 Bytes
| 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)} | |