Files

81 lines
4.8 KiB
Python

"""HK Public Holidays data
Source: https://www.gov.hk/en/about/abouthk/holiday/{year}.htm
Last verified: 2026-07-19
Format: (date ISO, name 中文, name_en English, is_mandatory)
"""
from datetime import date
# HK General Holidays 2025-2027 (gov.hk official)
# is_mandatory = True means statutory labour holiday (法定假日)
# False means general holiday only (銀行/學校等)
HK_HOLIDAYS = [
# ============ 2025 ============
(date(2025, 1, 1), "元旦", "The first day of January", True),
(date(2025, 1, 29), "農曆年初一", "Lunar New Year's Day", True),
(date(2025, 1, 30), "農曆年初二", "The second day of Lunar New Year", True),
(date(2025, 1, 31), "農曆年初三", "The third day of Lunar New Year", True),
(date(2025, 4, 4), "清明節", "Ching Ming Festival", True),
(date(2025, 4, 18), "耶穌受難日", "Good Friday", False),
(date(2025, 4, 19), "耶穌受難日翌日", "The day following Good Friday", False),
(date(2025, 4, 21), "復活節星期一", "Easter Monday", False),
(date(2025, 5, 1), "勞動節", "Labour Day", True),
(date(2025, 5, 5), "佛誕", "The Birthday of the Buddha", True),
(date(2025, 5, 31), "端午節", "Tuen Ng Festival", True),
(date(2025, 7, 1), "香港特別行政區成立紀念日", "Hong Kong Special Administrative Region Establishment Day", True),
(date(2025, 10, 1), "國慶日", "National Day", True),
(date(2025, 10, 7), "中秋節翌日", "The day following the Chinese Mid-Autumn Festival", False),
(date(2025, 10, 29), "重陽節", "Chung Yeung Festival", True),
(date(2025, 12, 25), "聖誕節", "Christmas Day", True),
(date(2025, 12, 26), "聖誕節翌日", "The first weekday after Christmas Day", False),
# ============ 2026 ============
(date(2026, 1, 1), "元旦", "The first day of January", True),
(date(2026, 2, 17), "農曆年初一", "Lunar New Year's Day", True),
(date(2026, 2, 18), "農曆年初二", "The second day of Lunar New Year", True),
(date(2026, 2, 19), "農曆年初三", "The third day of Lunar New Year", True),
(date(2026, 4, 3), "耶穌受難日", "Good Friday", False),
(date(2026, 4, 4), "耶穌受難日翌日", "The day following Good Friday", False),
(date(2026, 4, 6), "清明節翌日", "The day following Ching Ming Festival", True),
(date(2026, 4, 7), "復活節星期一翌日", "The day following Easter Monday", False),
(date(2026, 5, 1), "勞動節", "Labour Day", True),
(date(2026, 5, 25), "佛誕翌日", "The day following the Birthday of the Buddha", True),
(date(2026, 6, 19), "端午節", "Tuen Ng Festival", True),
(date(2026, 7, 1), "香港特別行政區成立紀念日", "Hong Kong Special Administrative Region Establishment Day", True),
(date(2026, 9, 26), "中秋節翌日", "The day following the Chinese Mid-Autumn Festival", False),
(date(2026, 10, 1), "國慶日", "National Day", True),
(date(2026, 10, 19), "重陽節翌日", "The day following Chung Yeung Festival", True),
(date(2026, 12, 25), "聖誕節", "Christmas Day", True),
(date(2026, 12, 26), "聖誕節翌日", "The first weekday after Christmas Day", False),
# ============ 2027 ============
(date(2027, 1, 1), "元旦", "The first day of January", True),
(date(2027, 2, 6), "農曆年初一", "Lunar New Year's Day", True),
(date(2027, 2, 8), "農曆年初三", "The third day of Lunar New Year", True),
(date(2027, 2, 9), "農曆年初四", "The fourth day of Lunar New Year", True),
(date(2027, 3, 26), "耶穌受難日", "Good Friday", False),
(date(2027, 3, 27), "耶穌受難日翌日", "The day following Good Friday", False),
(date(2027, 3, 29), "復活節星期一", "Easter Monday", False),
(date(2027, 4, 5), "清明節", "Ching Ming Festival", True),
(date(2027, 5, 1), "勞動節", "Labour Day", True),
(date(2027, 5, 13), "佛誕", "The Birthday of the Buddha", True),
(date(2027, 6, 9), "端午節", "Tuen Ng Festival", True),
(date(2027, 7, 1), "香港特別行政區成立紀念日", "Hong Kong Special Administrative Region Establishment Day", True),
(date(2027, 9, 16), "中秋節翌日", "The day following the Chinese Mid-Autumn Festival", False),
(date(2027, 10, 1), "國慶日", "National Day", True),
(date(2027, 10, 8), "重陽節", "Chung Yeung Festival", True),
(date(2027, 12, 25), "聖誕節", "Christmas Day", True),
(date(2027, 12, 27), "聖誕節翌日", "The first weekday after Christmas Day", False),
]
GOV_HK_URL_TEMPLATE = "https://www.gov.hk/en/about/abouthk/holiday/{year}.htm"
def get_holidays_for_year(year: int):
"""Return list of (date, name_zh, name_en, is_mandatory) for given year."""
return [h for h in HK_HOLIDAYS if h[0].year == year]
def get_all_holidays():
"""Return full HK_HOLIDAYS list."""
return list(HK_HOLIDAYS)