vacanza / python-holidays

Generate and work with holidays in Python
https://pypi.org/project/holidays
MIT License
1.44k stars 459 forks source link

Implement Taiwan's unofficial holidays #1912

Open Curtis081 opened 1 month ago

Curtis081 commented 1 month ago

Bug Report

Expected & Actual Behavior

Labor Day is a holiday. but the information not in the module(holidays) - Taiwan class

Environment

Additional Context

The following is my use example, it will raise the Error. Cause the variable this_is_holiday not in tw_holidays.

import holidays
from datetime import datetime

Taiwan_labor_day = datetime(2024, 5, 1)
Double_tenth_Day = datetime(2024, 10, 10)

the_day = Taiwan_labor_day

tw_holidays = holidays.Taiwan()
this_is_holiday = the_day in tw_holidays
assert this_is_holiday
arkid15r commented 1 month ago

Thanks for reporting this @Curtis081 It seems there is a list of unofficial holidays that hasn't been covered yet.

I've updated the issue title based on that info.

Curtis081 commented 1 month ago

Thank you for your attention and assistance! I have resolved the issue in my project by adding conditional statements.

By the way, there was a small problem with Python inspections: it showed the message "Cannot find reference 'Taiwan' in 'init.py.'"

Thanks again!