Skip to content

Commit 18216c1

Browse files
Merge branch 'dev' into dev
Signed-off-by: Harshil Gupta <[email protected]>
2 parents f8a80b3 + 48a2cc0 commit 18216c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+6016
-196
lines changed

CHANGES.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
# Version 0.76
2+
3+
Released July 7, 2025
4+
5+
- Add Bonaire, Sint Eustatius and Saba holidays (#2651 by @Prateekshit73, @arkid15r)
6+
- Add Falkland Islands holidays (#2697 by @Abheelash-Mishra)
7+
- Add Libya holidays (#2671 by @kritibirda26)
8+
- Add Mauritius holidays (#2643 by @kritibirda26)
9+
- Add Mongolia holidays (#2601 by @ankushhKapoor, @arkid15r)
10+
- Add Sint Maarten holidays (#2631 by @psupra22, @arkid15r)
11+
- Add working day tests for countries with substituted holidays (#2695 by @KJhellico)
12+
- Fix iCal exporter tests (#2689 by @KJhellico)
13+
- Update Aruba, Curaçao, Netherlands holidays: general code refactor (#2677 by @PPsyrius)
14+
- Update Cocos Islands holidays: fix 2023 Eid al-Fitr date (#2683 by @KJhellico)
15+
- Update France holidays: refactors, add `th` l10n (#2642 by @PPsyrius)
16+
- Update San Marino holidays, add l10n support (#2684 by @KJhellico)
17+
- Update Svalbard and Jan Mayen holidays: remove l10n overrides (#2649 by @PPsyrius)
18+
- Update Taiwan holidays (#2653 by @KJhellico)
19+
- Update United States holidays: add `th` l10n (#2678 by @PPsyrius)
20+
- Update Uzbekistan holidays: add 2024-2025 exact dates (#2679 by @KJhellico)
21+
- Update l10n for RTL languages (#2676 by @KJhellico)
22+
- Update l10n helper script (#2699 by @KJhellico)
23+
- Update pytest configuration (#2640 by @KJhellico)
24+
- Archive a link for Turks and Caicos holidays (#2688 by @kritibirda26)
25+
- Reformat .po files (#2673 by @KJhellico)
26+
- Show test coverage details by default (#2686 by @arkid15r)
27+
- Simplify parent-based entity handling (#2685 by @arkid15r)
28+
129
# Version 0.75
230

331
Released June 16, 2025

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,13 @@ any) in brackets, available languages and additional holiday categories. All cou
427427
<td>HALF_DAY</td>
428428
</tr>
429429
<tr>
430+
<td>Christmas Island</td>
431+
<td>CX</td>
432+
<td></td>
433+
<td><strong>en_CX</strong>, en_US</td>
434+
<td></td>
435+
</tr>
436+
<tr>
430437
<td>Cocos Islands</td>
431438
<td>CC</td>
432439
<td></td>
@@ -1148,6 +1155,13 @@ any) in brackets, available languages and additional holiday categories. All cou
11481155
<td>ARMED_FORCES, HALF_DAY</td>
11491156
</tr>
11501157
<tr>
1158+
<td>Palestine</td>
1159+
<td>PS</td>
1160+
<td></td>
1161+
<td><strong>ar</strong>, en_US</td>
1162+
<td>CATHOLIC, ORTHODOX</td>
1163+
</tr>
1164+
<tr>
11511165
<td>Panama</td>
11521166
<td>PA</td>
11531167
<td></td>
@@ -1273,6 +1287,13 @@ any) in brackets, available languages and additional holiday categories. All cou
12731287
<td></td>
12741288
</tr>
12751289
<tr>
1290+
<td>Saint Vincent and the Grenadines</td>
1291+
<td>VC</td>
1292+
<td></td>
1293+
<td>en_US, <strong>en_VC</strong></td>
1294+
<td></td>
1295+
</tr>
1296+
<tr>
12761297
<td>Samoa</td>
12771298
<td>WS</td>
12781299
<td></td>

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
| Version | Supported |
66
|---------| ------------------ |
7-
| 0.75 | :white_check_mark: |
8-
| < 0.75 | :x: |
7+
| 0.76 | :white_check_mark: |
8+
| < 0.76 | :x: |
99

1010
## Reporting a Vulnerability
1111

holidays/countries/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
from holidays.countries.chad import Chad, TD, TCD
5353
from holidays.countries.chile import Chile, CL, CHL
5454
from holidays.countries.china import China, CN, CHN
55+
from holidays.countries.christmas_island import ChristmasIsland, CX, CXR
5556
from holidays.countries.cocos_islands import CocosIslands, CC, CCK
5657
from holidays.countries.colombia import Colombia, CO, COL
5758
from holidays.countries.congo import Congo, CG, COG
@@ -160,6 +161,7 @@
160161
from holidays.countries.oman import Oman, OM, OMN
161162
from holidays.countries.pakistan import Pakistan, PK, PAK
162163
from holidays.countries.palau import Palau, PW, PLW
164+
from holidays.countries.palestine import Palestine, PS, PSE
163165
from holidays.countries.panama import Panama, PA, PAN
164166
from holidays.countries.papua_new_guinea import PapuaNewGuinea, PG, PNG
165167
from holidays.countries.paraguay import Paraguay, PY, PRY
@@ -183,6 +185,11 @@
183185
SPM,
184186
HolidaysPM,
185187
)
188+
from holidays.countries.saint_vincent_and_the_grenadines import (
189+
SaintVincentAndTheGrenadines,
190+
VC,
191+
VCT,
192+
)
186193
from holidays.countries.samoa import Samoa, WS, WSM
187194
from holidays.countries.san_marino import SanMarino, SM, SMR
188195
from holidays.countries.sao_tome_and_principe import SaoTomeAndPrincipe, ST, STP

holidays/countries/australia.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ def _populate_subdiv_qld_public_holidays(self):
529529
}
530530
# The Royal Queensland Show.
531531
name = tr("The Royal Queensland Show")
532-
if self._year in ekka_dates:
533-
self._add_holiday(name, ekka_dates[self._year])
532+
if dt := ekka_dates.get(self._year):
533+
self._add_holiday(name, dt)
534534
else:
535535
# [1st FRI after Aug 5] + 5 days = [1st WED after Aug 10]
536536
self._add_holiday_1st_wed_from_aug_10(name)
@@ -839,8 +839,8 @@ def _populate_subdiv_vic_public_holidays(self):
839839
}
840840
# Grand Final Day.
841841
name = tr("Grand Final Day")
842-
if self._year in grand_final_dates:
843-
self._add_holiday(name, grand_final_dates[self._year])
842+
if dt := grand_final_dates.get(self._year):
843+
self._add_holiday(name, dt)
844844
else:
845845
self._add_holiday_1_day_prior_last_sat_of_sep(name)
846846

@@ -937,10 +937,8 @@ def _populate_subdiv_wa_public_holidays(self):
937937
2012: (OCT, 1),
938938
2024: (SEP, 23),
939939
}
940-
if self._year in sovereign_birthday_dates:
941-
self._add_holiday(
942-
self.sovereign_birthday, sovereign_birthday_dates[self._year]
943-
)
940+
if dt := sovereign_birthday_dates.get(self._year):
941+
self._add_holiday(self.sovereign_birthday, dt)
944942
else:
945943
self._add_holiday_last_mon_of_sep(self.sovereign_birthday)
946944
else:

holidays/countries/british_virgin_islands.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def _populate_public_holidays(self):
8989
2019: (JUN, 7),
9090
2023: (JUN, 16),
9191
}
92-
if self._year in sovereign_birthday_dates:
93-
self._add_holiday(name, sovereign_birthday_dates[self._year])
92+
if dt := sovereign_birthday_dates.get(self._year):
93+
self._add_holiday(name, dt)
9494
else:
9595
self._add_holiday_2nd_fri_of_jun(name)
9696
else:
@@ -110,8 +110,8 @@ def _populate_public_holidays(self):
110110
2015: (JUN, 29),
111111
2020: (JUN, 29),
112112
}
113-
if self._year in territory_day_dates:
114-
self._add_holiday(name, territory_day_dates[self._year])
113+
if dt := territory_day_dates.get(self._year):
114+
self._add_holiday(name, dt)
115115
else:
116116
if self._year >= 2021:
117117
self._add_holiday_1st_mon_of_jul(name)
@@ -151,8 +151,8 @@ def _populate_public_holidays(self):
151151
2015: (OCT, 19),
152152
2020: (OCT, 23),
153153
}
154-
if self._year in saint_ursula_dates:
155-
self._add_holiday(name, saint_ursula_dates[self._year])
154+
if dt := saint_ursula_dates.get(self._year):
155+
self._add_holiday(name, dt)
156156
else:
157157
self._add_observed(
158158
self._add_holiday_oct_21(name), rule=SAT_TO_PREV_FRI + SUN_TO_NEXT_MON
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
# holidays
2+
# --------
3+
# A fast, efficient Python library for generating country, province and state
4+
# specific sets of holidays on the fly. It aims to make determining whether a
5+
# specific date is a holiday as fast and flexible as possible.
6+
#
7+
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS file)
8+
# dr-prodigy <[email protected]> (c) 2017-2023
9+
# ryanss <[email protected]> (c) 2014-2017
10+
# Website: https://github.com/vacanza/holidays
11+
# License: MIT (see LICENSE file)
12+
13+
from gettext import gettext as tr
14+
15+
from holidays.calendars import _CustomChineseHolidays, _CustomIslamicHolidays
16+
from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
17+
from holidays.groups import (
18+
ChineseCalendarHolidays,
19+
ChristianHolidays,
20+
InternationalHolidays,
21+
IslamicHolidays,
22+
StaticHolidays,
23+
)
24+
from holidays.observed_holiday_base import (
25+
ObservedHolidayBase,
26+
MON_TO_NEXT_TUE,
27+
SAT_SUN_TO_NEXT_MON,
28+
SAT_SUN_TO_NEXT_MON_TUE,
29+
)
30+
31+
32+
class ChristmasIsland(
33+
ObservedHolidayBase,
34+
ChineseCalendarHolidays,
35+
ChristianHolidays,
36+
InternationalHolidays,
37+
IslamicHolidays,
38+
StaticHolidays,
39+
):
40+
"""Christmas Island holidays.
41+
42+
References:
43+
* <https://en.wikipedia.org/wiki/Public_holidays_in_Christmas_Island>
44+
* [2007](https://web.archive.org/web/20250612072036/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_gazette/files/2006/01-2006_Public_Holidays_2007_CI.doc)
45+
* [2008](https://web.archive.org/web/20240224131231/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_gazette/files/2007/05-2007_Public_Holidays_CI.pdf)
46+
* [2008 Hari Raya Puasa](https://web.archive.org/web/20240331104649/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_gazette/files/2008/03_2008_Observance_of_Hari_Raya_Puasa_2008.pdf)
47+
* [2009](https://web.archive.org/web/20231211180406/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_gazette/files/2008/02-2008_2009_public_holiday_CI_gazette.pdf)
48+
* [2010](https://web.archive.org/web/20250612051603/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_gazette/files/2009/2009-Gazette_5-2009-CI-Proclamation_of_2010_Special_Public_and_Bank_Holidays.pdf)
49+
* [2013](https://web.archive.org/web/20240805060802/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_gazette/files/2012/2012-Gazette_7-2012-CI-Proclamation_of_2013_Public_Holidays_for_Christmas_Island.pdf)
50+
* [2014](https://web.archive.org/web/20240718175750/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_gazette/files/2013/2013-Gazette_2-2013-Christmas_Island_2014_Public_Holidays.pdf)
51+
* [2016 Hari Raya Puasa](https://web.archive.org/web/20240222235345/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_gazette/files/2016/2016-Gazette_4-2016-CI-Proclamation_Special_Public_and_Bank_Holidays_2016.pdf)
52+
* [2017](https://web.archive.org/web/20240226014639/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_gazette/files/2016/2016-Gazette_1-2016-CI-Proclamation_Special_Public_and_Bank_Holidays_2017.pdf)
53+
* [2019](https://web.archive.org/web/20250517064053/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_bulletins/2018/files/A37-2018.pdf)
54+
* [2020](https://web.archive.org/web/20240830230128/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_bulletins/2019/files/A52-2019.pdf)
55+
* [2021](https://web.archive.org/web/20240713155232/https://www.infrastructure.gov.au/sites/default/files/migrated/territories/indian_ocean/iot_bulletins/2020/files/a40-ci-public-holidays-2021-proclamation.pdf)
56+
* [2022](https://web.archive.org/web/20240626092850/https://www.infrastructure.gov.au/sites/default/files/documents/a32-2021-2022-public-holidays-christmas-island.pdf)
57+
* [2023](https://web.archive.org/web/20250612044842/https://www.infrastructure.gov.au/sites/default/files/documents/A06-2022-notice-proclamation-special-public-bank-holidays-2023-ci.pdf)
58+
* [2023 Hari Raya Haji](https://web.archive.org/web/20240804112114/https://www.infrastructure.gov.au/sites/default/files/documents/a06-2023_community_bulletin_-_change_of_public_holiday_date_for_hari_raya_haji_2023.pdf)
59+
* [2024](https://web.archive.org/web/20240519034837/https://www.infrastructure.gov.au/sites/default/files/documents/a11-2023-2024-public-holidays-christmas-island.pdf)
60+
* [2025](https://web.archive.org/web/20250610185153/https://www.infrastructure.gov.au/sites/default/files/documents/a20-2024-administrator-community-bulletin-ci-public-holidays-2025.pdf)
61+
"""
62+
63+
country = "CX"
64+
default_language = "en_CX"
65+
# %s (observed).
66+
observed_label = tr("%s (observed)")
67+
# %s (estimated).
68+
estimated_label = tr("%s (estimated)")
69+
# %s (observed, estimated).
70+
observed_estimated_label = tr("%s (observed, estimated)")
71+
supported_languages = ("en_CX", "en_US")
72+
start_year = 2007
73+
74+
def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
75+
ChineseCalendarHolidays.__init__(self, cls=ChristmasIslandChineseHolidays)
76+
ChristianHolidays.__init__(self)
77+
InternationalHolidays.__init__(self)
78+
IslamicHolidays.__init__(
79+
self, cls=ChristmasIslandIslamicHolidays, show_estimated=islamic_show_estimated
80+
)
81+
StaticHolidays.__init__(self, ChristmasIslandStaticHolidays)
82+
kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_MON)
83+
super().__init__(*args, **kwargs)
84+
85+
def _populate_public_holidays(self):
86+
# New Year's Day.
87+
self._add_observed(self._add_new_years_day(tr("New Year's Day")))
88+
89+
# Australia Day.
90+
self._add_observed(self._add_holiday_jan_26(tr("Australia Day")))
91+
92+
# Chinese New Year.
93+
name = tr("Chinese New Year")
94+
if self._year != 2020:
95+
self._add_observed(self._add_chinese_new_years_day(name), rule=SAT_SUN_TO_NEXT_MON_TUE)
96+
self._add_observed(
97+
self._add_chinese_new_years_day_two(name), rule=SAT_SUN_TO_NEXT_MON_TUE
98+
)
99+
100+
# Labor Day.
101+
name = tr("Labour Day")
102+
if self._year in {2009, 2010, 2014, 2021, 2025}:
103+
self._add_holiday_4th_mon_of_mar(name)
104+
else:
105+
self._add_holiday_3rd_mon_of_mar(name)
106+
107+
# Good Friday.
108+
self._add_good_friday(tr("Good Friday"))
109+
110+
# ANZAC Day.
111+
self._add_observed(self._add_anzac_day(tr("ANZAC Day")))
112+
113+
# Territory Day.
114+
self._add_holiday_1st_mon_of_oct(tr("Territory Day"))
115+
116+
self._add_observed(
117+
# Boxing Day.
118+
self._add_christmas_day_two(tr("Boxing Day")),
119+
rule=SAT_SUN_TO_NEXT_MON_TUE + MON_TO_NEXT_TUE,
120+
)
121+
122+
# Christmas Day.
123+
self._add_observed(self._add_christmas_day(tr("Christmas Day")))
124+
125+
# Eid al-Fitr.
126+
for dt in self._add_eid_al_fitr_day(tr("Hari Raya Puasa")):
127+
self._add_observed(dt)
128+
129+
# Eid al-Adha.
130+
for dt in self._add_eid_al_adha_day(tr("Hari Raya Haji")):
131+
if self._year not in {2014, 2025}:
132+
self._add_observed(dt)
133+
134+
135+
class ChristmasIslandChineseHolidays(_CustomChineseHolidays):
136+
LUNAR_NEW_YEAR_DATES = {
137+
2007: (FEB, 19),
138+
2009: (JAN, 27),
139+
2010: (FEB, 15),
140+
2023: (JAN, 23),
141+
}
142+
143+
144+
class ChristmasIslandIslamicHolidays(_CustomIslamicHolidays):
145+
EID_AL_ADHA_DATES = {
146+
2007: (DEC, 20),
147+
2008: (DEC, 8),
148+
2009: (NOV, 30),
149+
2010: (NOV, 16),
150+
2013: (OCT, 15),
151+
2014: (OCT, 5),
152+
2016: (SEP, 13),
153+
2017: (SEP, 1),
154+
2019: (AUG, 11),
155+
2020: (JUL, 31),
156+
2021: (JUL, 20),
157+
2022: (JUL, 9),
158+
2023: (JUN, 28),
159+
2024: (JUN, 17),
160+
2025: (JUN, 7),
161+
}
162+
163+
EID_AL_FITR_DATES = {
164+
2007: (OCT, 15),
165+
2008: (OCT, 1),
166+
2009: (SEP, 21),
167+
2010: (SEP, 10),
168+
2013: (AUG, 8),
169+
2014: (JUL, 28),
170+
2016: (JUL, 6),
171+
2017: (JUN, 24),
172+
2019: (JUN, 5),
173+
2020: (MAY, 24),
174+
2021: (MAY, 13),
175+
2022: (MAY, 2),
176+
2023: (APR, 22),
177+
2024: (APR, 10),
178+
2025: (MAR, 31),
179+
}
180+
181+
182+
class CX(ChristmasIsland):
183+
pass
184+
185+
186+
class CXR(ChristmasIsland):
187+
pass
188+
189+
190+
class ChristmasIslandStaticHolidays:
191+
"""Christmas Island special holidays.
192+
193+
References:
194+
* [National Day of Mourning 2022](https://web.archive.org/web/20240712013008/https://www.infrastructure.gov.au/sites/default/files/documents/03-2022-proclamation-ci-day-of-mourning.pdf)
195+
"""
196+
197+
# Chinese New Year.
198+
chinese_new_year = tr("Chinese New Year")
199+
200+
# Eid al-Adha.
201+
eid_al_adha = tr("Hari Raya Haji")
202+
203+
special_public_holidays = {
204+
# National Day of Mourning for Queen Elizabeth II.
205+
2022: (SEP, 22, tr("National Day of Mourning for Queen Elizabeth II")),
206+
}
207+
208+
special_public_holidays_observed = {
209+
2014: (OCT, 7, eid_al_adha),
210+
2020: (
211+
(JAN, 28, chinese_new_year),
212+
(JAN, 29, chinese_new_year),
213+
),
214+
2025: (JUN, 6, eid_al_adha),
215+
}

0 commit comments

Comments
 (0)