holidays 0.66__py3-none-any.whl → 0.68__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- holidays/calendars/chinese.py +1 -1
- holidays/countries/__init__.py +2 -0
- holidays/countries/australia.py +6 -6
- holidays/countries/azerbaijan.py +18 -2
- holidays/countries/cambodia.py +1 -1
- holidays/countries/chile.py +1 -1
- holidays/countries/cuba.py +1 -1
- holidays/countries/denmark.py +1 -1
- holidays/countries/finland.py +19 -19
- holidays/countries/greenland.py +22 -19
- holidays/countries/guatemala.py +1 -1
- holidays/countries/haiti.py +3 -3
- holidays/countries/hongkong.py +124 -174
- holidays/countries/isle_of_man.py +15 -11
- holidays/countries/kazakhstan.py +1 -1
- holidays/countries/kenya.py +201 -45
- holidays/countries/laos.py +2 -2
- holidays/countries/malaysia.py +21 -3
- holidays/countries/nicaragua.py +1 -1
- holidays/countries/panama.py +69 -31
- holidays/countries/peru.py +1 -1
- holidays/countries/saint_lucia.py +88 -0
- holidays/countries/seychelles.py +4 -4
- holidays/countries/singapore.py +1 -1
- holidays/countries/spain.py +9 -9
- holidays/countries/sri_lanka.py +1 -1
- holidays/countries/switzerland.py +1 -1
- holidays/countries/tuvalu.py +174 -0
- holidays/countries/united_kingdom.py +72 -56
- holidays/countries/united_states.py +141 -10
- holidays/countries/uruguay.py +1 -1
- holidays/financial/brasil_bolsa_balcao.py +1 -1
- holidays/holiday_base.py +62 -13
- holidays/locale/da/LC_MESSAGES/GL.mo +0 -0
- holidays/locale/en_GB/LC_MESSAGES/GB.mo +0 -0
- holidays/locale/en_GB/LC_MESSAGES/IM.mo +0 -0
- holidays/locale/en_GB/LC_MESSAGES/TV.mo +0 -0
- holidays/locale/en_HK/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/en_KE/LC_MESSAGES/KE.mo +0 -0
- holidays/locale/en_LC/LC_MESSAGES/LC.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CH.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CL.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CO.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CU.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/DK.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/FI.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GB.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GL.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GT.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/HT.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/IM.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/KE.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/KH.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/KZ.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/LA.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/LC.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/LK.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MY.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/NI.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/PA.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/PE.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/RU.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/SC.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/TV.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/UY.mo +0 -0
- holidays/locale/es/LC_MESSAGES/PA.mo +0 -0
- holidays/locale/fi/LC_MESSAGES/GL.mo +0 -0
- holidays/locale/is/LC_MESSAGES/GL.mo +0 -0
- holidays/locale/kl/LC_MESSAGES/GL.mo +0 -0
- holidays/locale/ms_MY/LC_MESSAGES/MY.mo +0 -0
- holidays/locale/no/LC_MESSAGES/GL.mo +0 -0
- holidays/locale/sv/LC_MESSAGES/GL.mo +0 -0
- holidays/locale/sw/LC_MESSAGES/KE.mo +0 -0
- holidays/locale/th/LC_MESSAGES/GB.mo +0 -0
- holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/th/LC_MESSAGES/IM.mo +0 -0
- holidays/locale/th/LC_MESSAGES/MY.mo +0 -0
- holidays/locale/tvl/LC_MESSAGES/TV.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/DK.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/GE.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/GL.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/MC.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/MG.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/PA.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/RO.mo +0 -0
- holidays/locale/zh_CN/LC_MESSAGES/HK.mo +0 -0
- holidays/locale/zh_HK/LC_MESSAGES/HK.mo +0 -0
- holidays/registry.py +2 -0
- holidays/version.py +1 -1
- {holidays-0.66.dist-info → holidays-0.68.dist-info}/AUTHORS +1 -0
- {holidays-0.66.dist-info → holidays-0.68.dist-info}/METADATA +35 -19
- {holidays-0.66.dist-info → holidays-0.68.dist-info}/RECORD +100 -71
- {holidays-0.66.dist-info → holidays-0.68.dist-info}/WHEEL +1 -1
- {holidays-0.66.dist-info → holidays-0.68.dist-info}/LICENSE +0 -0
- {holidays-0.66.dist-info → holidays-0.68.dist-info}/top_level.txt +0 -0
|
@@ -49,11 +49,36 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
49
49
|
Frances Xavier Cabrini Day:
|
|
50
50
|
- https://leg.colorado.gov/sites/default/files/2020a_1031_signed.pdf
|
|
51
51
|
|
|
52
|
-
Washington's Birthday
|
|
53
|
-
- https://
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- https://www.
|
|
52
|
+
Washington's Birthday:
|
|
53
|
+
- AK: https://doa.alaska.gov/calendar/
|
|
54
|
+
- AL: https://admincode.legislature.state.al.us/administrative-code/670-X-12-.01
|
|
55
|
+
- AR: https://arkleg.state.ar.us/Home/FTPDocument?path=/ACTS/2001/Public/ACT304.pdf
|
|
56
|
+
- AZ: https://www.azleg.gov/ars/1/00301.htm
|
|
57
|
+
- CA: https://www.sos.ca.gov/state-holidays
|
|
58
|
+
- CO: https://leg.colorado.gov/sites/default/files/images/olls/crs2023-title-24.pdf
|
|
59
|
+
- GA: https://www.gasupreme.us/court-information/holidays-2/
|
|
60
|
+
- HI: https://www.capitol.hawaii.gov/hrscurrent/Vol01_Ch0001-0042F/HRS0008/HRS_0008-0001.htm
|
|
61
|
+
- ID: https://idaho.gov/government/state-holidays/
|
|
62
|
+
- IN: https://digital.statelib.lib.in.us/infoexpress/holidays.aspx
|
|
63
|
+
https://www.in.gov/spd/benefits/state-holidays/
|
|
64
|
+
- MD: https://msa.maryland.gov/msa/mdmanual/01glance/html/holidayl.html
|
|
65
|
+
- MN: https://www.revisor.mn.gov/statutes/cite/645.44
|
|
66
|
+
- MT: https://archive.legmt.gov/bills/mca/title_0010/chapter_0010/part_0020/section_0160/0010-0010-0020-0160.html
|
|
67
|
+
- NJ: https://nj.gov/nj/about/facts/holidays/
|
|
68
|
+
- OH: https://codes.ohio.gov/ohio-revised-code/section-1.14
|
|
69
|
+
- OK: https://oklahoma.gov/omes/divisions/human-capital-management/employee-benefits/leave-holidays/holidays.html
|
|
70
|
+
- OR: https://www.oregonlegislature.gov/bills_laws/ors/ors187.html
|
|
71
|
+
- PA: https://www.legis.state.pa.us/WU01/LI/LI/US/PDF/1893/0/0138..PDF
|
|
72
|
+
- PR: https://en.wikipedia.org/wiki/Public_holidays_in_Puerto_Rico
|
|
73
|
+
- SC: https://www.scstatehouse.gov/code/t53c005.php
|
|
74
|
+
- TN: https://www.tn.gov/about-tn/state-holidays.html
|
|
75
|
+
- TX: https://www.tsl.texas.gov/ref/abouttx/holidays
|
|
76
|
+
- UT: https://le.utah.gov/xcode/Title63G/Chapter1/63G-1-S301.html
|
|
77
|
+
- VA: https://law.lis.virginia.gov/vacode/title2.2/chapter33/section2.2-3300/
|
|
78
|
+
- VT: https://legislature.vermont.gov/statutes/section/01/007/00371
|
|
79
|
+
- WA: https://app.leg.wa.gov/rcw/default.aspx?cite=1.16.050
|
|
80
|
+
- WV: https://code.wvlegislature.gov/2-2-1/
|
|
81
|
+
- WY: https://ai.wyo.gov/about-us/state-holidays-and-office-closures
|
|
57
82
|
|
|
58
83
|
American Samoa holidays:
|
|
59
84
|
- https://asbar.org/code-annotated/1-0501-public-holidays/
|
|
@@ -197,15 +222,38 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
197
222
|
|
|
198
223
|
# Washington's Birthday
|
|
199
224
|
if self._year >= 1879 and self.subdiv not in {
|
|
225
|
+
"AK",
|
|
200
226
|
"AL",
|
|
201
227
|
"AR",
|
|
228
|
+
"AZ",
|
|
229
|
+
"CA",
|
|
230
|
+
"CO",
|
|
202
231
|
"DE",
|
|
203
232
|
"FL",
|
|
204
233
|
"GA",
|
|
234
|
+
"HI",
|
|
235
|
+
"ID",
|
|
205
236
|
"IN",
|
|
237
|
+
"MD",
|
|
238
|
+
"MN",
|
|
239
|
+
"MT",
|
|
240
|
+
"NJ",
|
|
206
241
|
"NM",
|
|
242
|
+
"OH",
|
|
243
|
+
"OK",
|
|
244
|
+
"OR",
|
|
245
|
+
"PA",
|
|
207
246
|
"PR",
|
|
247
|
+
"SC",
|
|
248
|
+
"TN",
|
|
249
|
+
"TX",
|
|
250
|
+
"UT",
|
|
251
|
+
"VA",
|
|
208
252
|
"VI",
|
|
253
|
+
"VT",
|
|
254
|
+
"WA",
|
|
255
|
+
"WV",
|
|
256
|
+
"WY",
|
|
209
257
|
}:
|
|
210
258
|
name = "Washington's Birthday"
|
|
211
259
|
if self._year >= 1971:
|
|
@@ -246,6 +294,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
246
294
|
super()._populate_subdiv_holidays()
|
|
247
295
|
|
|
248
296
|
def _populate_subdiv_ak_public_holidays(self):
|
|
297
|
+
# Washington's Birthday
|
|
298
|
+
if self._year >= 1971:
|
|
299
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
300
|
+
|
|
249
301
|
# Seward's Day
|
|
250
302
|
# No observance in 1921: https://chroniclingamerica.loc.gov/lccn/sn86072239/1922-03-29/ed-1/seq-8/
|
|
251
303
|
if self._year >= 1918 and self._year != 1921:
|
|
@@ -327,11 +379,19 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
327
379
|
if self._year >= 1986:
|
|
328
380
|
self._add_holiday_3rd_mon_of_jan("Dr. Martin Luther King Jr. / Civil Rights Day")
|
|
329
381
|
|
|
382
|
+
# Washington's Birthday
|
|
383
|
+
if self._year >= 1971:
|
|
384
|
+
self._add_holiday_3rd_mon_of_feb("Lincoln/Washington Presidents' Day")
|
|
385
|
+
|
|
330
386
|
def _populate_subdiv_ca_public_holidays(self):
|
|
331
387
|
# Lincoln's Birthday
|
|
332
388
|
if 1971 <= self._year <= 2009:
|
|
333
389
|
self._add_observed(self._add_holiday_feb_12("Lincoln's Birthday"))
|
|
334
390
|
|
|
391
|
+
# Washington's Birthday
|
|
392
|
+
if self._year >= 1971:
|
|
393
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
394
|
+
|
|
335
395
|
# Susan B. Anthony Day
|
|
336
396
|
if self._year >= 2014:
|
|
337
397
|
self._add_holiday_feb_15("Susan B. Anthony Day")
|
|
@@ -349,6 +409,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
349
409
|
self._add_holiday_1_day_past_4th_thu_of_nov("Day After Thanksgiving")
|
|
350
410
|
|
|
351
411
|
def _populate_subdiv_co_public_holidays(self):
|
|
412
|
+
# Washington's Birthday
|
|
413
|
+
if self._year >= 1971:
|
|
414
|
+
self._add_holiday_3rd_mon_of_feb("Washington-Lincoln Day")
|
|
415
|
+
|
|
352
416
|
# Cesar Chavez Day
|
|
353
417
|
if self._year >= 2001:
|
|
354
418
|
self._add_holiday_mar_31("Cesar Chavez Day")
|
|
@@ -453,6 +517,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
453
517
|
self._add_immaculate_conception_day("Lady of Camarin Day")
|
|
454
518
|
|
|
455
519
|
def _populate_subdiv_hi_public_holidays(self):
|
|
520
|
+
# Washington's Birthday
|
|
521
|
+
if self._year >= 1971:
|
|
522
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
523
|
+
|
|
456
524
|
# Prince Jonah Kuhio Kalanianaole Day
|
|
457
525
|
if self._year >= 1949:
|
|
458
526
|
self._add_observed(self._add_holiday_mar_26("Prince Jonah Kuhio Kalanianaole Day"))
|
|
@@ -485,6 +553,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
485
553
|
else "Martin Luther King Jr. Day"
|
|
486
554
|
)
|
|
487
555
|
|
|
556
|
+
# Washington's Birthday
|
|
557
|
+
if self._year >= 1971:
|
|
558
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
559
|
+
|
|
488
560
|
def _populate_subdiv_il_public_holidays(self):
|
|
489
561
|
# Lincoln's Birthday
|
|
490
562
|
if self._year >= 1971:
|
|
@@ -581,6 +653,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
581
653
|
rule=SUN_TO_NEXT_MON,
|
|
582
654
|
)
|
|
583
655
|
|
|
656
|
+
# Washington's Birthday
|
|
657
|
+
if self._year >= 1971:
|
|
658
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
659
|
+
|
|
584
660
|
# American Indian Heritage Day
|
|
585
661
|
if self._year >= 2008:
|
|
586
662
|
self._add_holiday_1_day_past_4th_thu_of_nov("American Indian Heritage Day")
|
|
@@ -609,7 +685,9 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
609
685
|
self._add_observed(self._add_new_years_eve("New Year's Eve"))
|
|
610
686
|
|
|
611
687
|
def _populate_subdiv_mn_public_holidays(self):
|
|
612
|
-
|
|
688
|
+
# Washington's Birthday
|
|
689
|
+
if self._year >= 1971:
|
|
690
|
+
self._add_holiday_3rd_mon_of_feb("Washington's and Lincoln's Birthday")
|
|
613
691
|
|
|
614
692
|
def _populate_subdiv_mo_public_holidays(self):
|
|
615
693
|
# Truman Day
|
|
@@ -648,6 +726,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
648
726
|
self._add_holiday_last_mon_of_apr("Confederate Memorial Day")
|
|
649
727
|
|
|
650
728
|
def _populate_subdiv_mt_public_holidays(self):
|
|
729
|
+
# Washington's Birthday
|
|
730
|
+
if self._year >= 1971:
|
|
731
|
+
self._add_holiday_3rd_mon_of_feb("Lincoln's and Washington's Birthdays")
|
|
732
|
+
|
|
651
733
|
# Election Day
|
|
652
734
|
if self._year >= 2008 and self._year % 2 == 0:
|
|
653
735
|
self._add_holiday_1_day_past_1st_mon_of_nov("Election Day")
|
|
@@ -711,6 +793,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
711
793
|
if self._year >= 1971:
|
|
712
794
|
self._add_observed(self._add_holiday_feb_12("Lincoln's Birthday"))
|
|
713
795
|
|
|
796
|
+
# Washington's Birthday
|
|
797
|
+
if self._year >= 1971:
|
|
798
|
+
self._add_holiday_3rd_mon_of_feb("Presidents Day")
|
|
799
|
+
|
|
714
800
|
# Good Friday
|
|
715
801
|
self._add_good_friday("Good Friday")
|
|
716
802
|
|
|
@@ -755,17 +841,29 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
755
841
|
self._add_holiday_1_day_past_1st_mon_of_nov("Election Day")
|
|
756
842
|
|
|
757
843
|
def _populate_subdiv_oh_public_holidays(self):
|
|
758
|
-
|
|
844
|
+
# Washington's Birthday
|
|
845
|
+
if self._year >= 1971:
|
|
846
|
+
self._add_holiday_3rd_mon_of_feb("Washington-Lincoln Day")
|
|
759
847
|
|
|
760
848
|
def _populate_subdiv_ok_public_holidays(self):
|
|
849
|
+
# Washington's Birthday
|
|
850
|
+
if self._year >= 1971:
|
|
851
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
852
|
+
|
|
761
853
|
# Day After Thanksgiving
|
|
762
854
|
if self._year >= 1975:
|
|
763
855
|
self._add_holiday_1_day_past_4th_thu_of_nov("Day After Thanksgiving")
|
|
764
856
|
|
|
765
857
|
def _populate_subdiv_or_public_holidays(self):
|
|
766
|
-
|
|
858
|
+
# Washington's Birthday
|
|
859
|
+
if self._year >= 1971:
|
|
860
|
+
self._add_holiday_3rd_mon_of_feb("Presidents Day")
|
|
767
861
|
|
|
768
862
|
def _populate_subdiv_pa_public_holidays(self):
|
|
863
|
+
# Washington's Birthday
|
|
864
|
+
if self._year >= 1971:
|
|
865
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
866
|
+
|
|
769
867
|
# Day After Thanksgiving
|
|
770
868
|
self._add_holiday_1_day_past_4th_thu_of_nov("Day After Thanksgiving")
|
|
771
869
|
|
|
@@ -800,6 +898,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
800
898
|
)
|
|
801
899
|
|
|
802
900
|
def _populate_subdiv_sc_public_holidays(self):
|
|
901
|
+
# Washington's Birthday
|
|
902
|
+
if self._year >= 1971:
|
|
903
|
+
self._add_holiday_3rd_mon_of_feb("President's Day")
|
|
904
|
+
|
|
803
905
|
# Confederate Memorial Day
|
|
804
906
|
if self._year >= 1866:
|
|
805
907
|
self._add_holiday_4th_mon_of_apr("Confederate Memorial Day")
|
|
@@ -814,6 +916,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
814
916
|
self._add_columbus_day(name)
|
|
815
917
|
|
|
816
918
|
def _populate_subdiv_tn_public_holidays(self):
|
|
919
|
+
# Washington's Birthday
|
|
920
|
+
if self._year >= 1971:
|
|
921
|
+
self._add_holiday_3rd_mon_of_feb("President's Day")
|
|
922
|
+
|
|
817
923
|
# Good Friday
|
|
818
924
|
self._add_good_friday("Good Friday")
|
|
819
925
|
|
|
@@ -822,6 +928,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
822
928
|
if self._year >= 1931:
|
|
823
929
|
self._add_holiday_jan_19("Confederate Memorial Day")
|
|
824
930
|
|
|
931
|
+
# Washington's Birthday
|
|
932
|
+
if self._year >= 1971:
|
|
933
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
934
|
+
|
|
825
935
|
# Texas Independence Day
|
|
826
936
|
if self._year >= 1874:
|
|
827
937
|
self._add_holiday_mar_2("Texas Independence Day")
|
|
@@ -861,6 +971,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
861
971
|
pass
|
|
862
972
|
|
|
863
973
|
def _populate_subdiv_ut_public_holidays(self):
|
|
974
|
+
# Washington's Birthday
|
|
975
|
+
if self._year >= 1971:
|
|
976
|
+
self._add_holiday_3rd_mon_of_feb("Washington and Lincoln Day")
|
|
977
|
+
|
|
864
978
|
# Pioneer Day
|
|
865
979
|
if self._year >= 1849:
|
|
866
980
|
self._add_observed(self._add_holiday_jul_24("Pioneer Day"))
|
|
@@ -885,6 +999,11 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
885
999
|
else self._add_holiday_mar_4(name),
|
|
886
1000
|
rule=SUN_TO_NEXT_MON,
|
|
887
1001
|
)
|
|
1002
|
+
|
|
1003
|
+
# Washington's Birthday
|
|
1004
|
+
if self._year >= 1971:
|
|
1005
|
+
self._add_holiday_3rd_mon_of_feb("George Washington Day")
|
|
1006
|
+
|
|
888
1007
|
# Indigenous Peoples' Day
|
|
889
1008
|
if self._year >= 1971:
|
|
890
1009
|
self._add_holiday_2nd_mon_of_oct(
|
|
@@ -932,6 +1051,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
932
1051
|
self._add_christmas_day_two("Christmas Second Day")
|
|
933
1052
|
|
|
934
1053
|
def _populate_subdiv_vt_public_holidays(self):
|
|
1054
|
+
# Washington's Birthday
|
|
1055
|
+
if self._year >= 1971:
|
|
1056
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
1057
|
+
|
|
935
1058
|
# Town Meeting Day
|
|
936
1059
|
if self._year >= 1800:
|
|
937
1060
|
self._add_holiday_1st_tue_of_mar("Town Meeting Day")
|
|
@@ -941,7 +1064,9 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
941
1064
|
self._add_observed(self._add_holiday_aug_16("Bennington Battle Day"))
|
|
942
1065
|
|
|
943
1066
|
def _populate_subdiv_wa_public_holidays(self):
|
|
944
|
-
|
|
1067
|
+
# Washington's Birthday
|
|
1068
|
+
if self._year >= 1971:
|
|
1069
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
945
1070
|
|
|
946
1071
|
def _populate_subdiv_wi_public_holidays(self):
|
|
947
1072
|
# Susan B. Anthony Day
|
|
@@ -956,6 +1081,10 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
956
1081
|
self._add_observed(self._add_new_years_eve("New Year's Eve"))
|
|
957
1082
|
|
|
958
1083
|
def _populate_subdiv_wv_public_holidays(self):
|
|
1084
|
+
# Washington's Birthday
|
|
1085
|
+
if self._year >= 1971:
|
|
1086
|
+
self._add_holiday_3rd_mon_of_feb("Presidents' Day")
|
|
1087
|
+
|
|
959
1088
|
# West Virginia Day
|
|
960
1089
|
if self._year >= 1927:
|
|
961
1090
|
self._add_observed(self._add_holiday_jun_20("West Virginia Day"))
|
|
@@ -969,7 +1098,9 @@ class UnitedStates(ObservedHolidayBase, ChristianHolidays, InternationalHolidays
|
|
|
969
1098
|
self._add_holiday_1_day_past_4th_thu_of_nov("Day After Thanksgiving")
|
|
970
1099
|
|
|
971
1100
|
def _populate_subdiv_wy_public_holidays(self):
|
|
972
|
-
|
|
1101
|
+
# Washington's Birthday
|
|
1102
|
+
if self._year >= 1971:
|
|
1103
|
+
self._add_holiday_3rd_mon_of_feb("President's Day")
|
|
973
1104
|
|
|
974
1105
|
def _populate_unofficial_holidays(self):
|
|
975
1106
|
# Very common celebrated cultural days, but no official observance.
|
holidays/countries/uruguay.py
CHANGED
|
@@ -61,7 +61,7 @@ class Uruguay(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Sta
|
|
|
61
61
|
# Cry of Asencio.
|
|
62
62
|
self._add_holiday_feb_28(tr("Grito de Asencio"))
|
|
63
63
|
|
|
64
|
-
#
|
|
64
|
+
# Workers' Day.
|
|
65
65
|
dt = self._add_labor_day(tr("Día de los Trabajadores"))
|
|
66
66
|
if self._year <= 1983:
|
|
67
67
|
self._move_holiday(dt)
|
|
@@ -70,7 +70,7 @@ class BrasilBolsaBalcao(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
70
70
|
self._add_holiday_apr_21(tr("Tiradentes"))
|
|
71
71
|
|
|
72
72
|
if self._year >= 1925:
|
|
73
|
-
#
|
|
73
|
+
# Worker's Day.
|
|
74
74
|
self._add_labor_day(tr("Dia do Trabalhador"))
|
|
75
75
|
|
|
76
76
|
# Corpus Christi.
|
holidays/holiday_base.py
CHANGED
|
@@ -14,13 +14,14 @@ __all__ = ("DateLike", "HolidayBase", "HolidaySum")
|
|
|
14
14
|
|
|
15
15
|
import copy
|
|
16
16
|
import warnings
|
|
17
|
+
from bisect import bisect_left, bisect_right
|
|
17
18
|
from calendar import isleap
|
|
18
19
|
from collections.abc import Iterable
|
|
19
20
|
from datetime import date, datetime, timedelta, timezone
|
|
20
21
|
from functools import cached_property
|
|
21
22
|
from gettext import gettext, translation
|
|
22
23
|
from pathlib import Path
|
|
23
|
-
from typing import Any,
|
|
24
|
+
from typing import Any, Literal, Optional, Union, cast
|
|
24
25
|
|
|
25
26
|
from dateutil.parser import parse
|
|
26
27
|
|
|
@@ -249,6 +250,8 @@ class HolidayBase(dict[date, str]):
|
|
|
249
250
|
"""Start year of holidays presence for this entity."""
|
|
250
251
|
end_year: int = DEFAULT_END_YEAR
|
|
251
252
|
"""End year of holidays presence for this entity."""
|
|
253
|
+
parent_entity: Optional[type["HolidayBase"]] = None
|
|
254
|
+
"""Optional parent entity to reference as a base."""
|
|
252
255
|
|
|
253
256
|
def __init__(
|
|
254
257
|
self,
|
|
@@ -364,16 +367,32 @@ class HolidayBase(dict[date, str]):
|
|
|
364
367
|
self.weekend_workdays = getattr(self, "weekend_workdays", set())
|
|
365
368
|
|
|
366
369
|
supported_languages = set(self.supported_languages)
|
|
367
|
-
self.
|
|
368
|
-
|
|
370
|
+
if self._entity_code is not None:
|
|
371
|
+
fallback = language not in supported_languages
|
|
372
|
+
languages = [language] if language in supported_languages else None
|
|
373
|
+
locale_directory = str(Path(__file__).with_name("locale"))
|
|
374
|
+
|
|
375
|
+
# Add entity native content translations.
|
|
376
|
+
entity_translation = translation(
|
|
369
377
|
self._entity_code,
|
|
370
|
-
fallback=
|
|
371
|
-
languages=
|
|
372
|
-
localedir=
|
|
373
|
-
)
|
|
374
|
-
if
|
|
375
|
-
|
|
376
|
-
|
|
378
|
+
fallback=fallback,
|
|
379
|
+
languages=languages,
|
|
380
|
+
localedir=locale_directory,
|
|
381
|
+
)
|
|
382
|
+
# Add a fallback if entity has parent translations.
|
|
383
|
+
if parent_entity := self.parent_entity:
|
|
384
|
+
entity_translation.add_fallback(
|
|
385
|
+
translation(
|
|
386
|
+
parent_entity.country or parent_entity.market,
|
|
387
|
+
fallback=fallback,
|
|
388
|
+
languages=languages,
|
|
389
|
+
localedir=locale_directory,
|
|
390
|
+
)
|
|
391
|
+
)
|
|
392
|
+
self.tr = entity_translation.gettext
|
|
393
|
+
else:
|
|
394
|
+
self.tr = gettext
|
|
395
|
+
|
|
377
396
|
self.years = _normalize_arguments(int, years)
|
|
378
397
|
|
|
379
398
|
# Populate holidays.
|
|
@@ -418,7 +437,7 @@ class HolidayBase(dict[date, str]):
|
|
|
418
437
|
if not isinstance(key, (date, datetime, float, int, str)):
|
|
419
438
|
raise TypeError(f"Cannot convert type '{type(key)}' to date.")
|
|
420
439
|
|
|
421
|
-
return dict.__contains__(cast("
|
|
440
|
+
return dict.__contains__(cast("dict[Any, Any]", self), self.__keytransform__(key))
|
|
422
441
|
|
|
423
442
|
def __eq__(self, other: object) -> bool:
|
|
424
443
|
if not isinstance(other, HolidayBase):
|
|
@@ -428,7 +447,7 @@ class HolidayBase(dict[date, str]):
|
|
|
428
447
|
if getattr(self, attribute_name, None) != getattr(other, attribute_name, None):
|
|
429
448
|
return False
|
|
430
449
|
|
|
431
|
-
return dict.__eq__(cast("
|
|
450
|
+
return dict.__eq__(cast("dict[Any, Any]", self), other)
|
|
432
451
|
|
|
433
452
|
def __getattr__(self, name):
|
|
434
453
|
try:
|
|
@@ -967,6 +986,36 @@ class HolidayBase(dict[date, str]):
|
|
|
967
986
|
|
|
968
987
|
raise AttributeError(f"Unknown lookup type: {lookup}")
|
|
969
988
|
|
|
989
|
+
def get_closest_holiday(
|
|
990
|
+
self,
|
|
991
|
+
target_date: DateLike = None,
|
|
992
|
+
direction: Literal["forward", "backward"] = "forward",
|
|
993
|
+
) -> Optional[tuple[date, str]]:
|
|
994
|
+
"""Return the date and name of the next holiday for a target_date
|
|
995
|
+
if direction is "forward" or the previous holiday if direction is "backward".
|
|
996
|
+
If target_date is not provided the current date will be used by default."""
|
|
997
|
+
|
|
998
|
+
if direction not in {"backward", "forward"}:
|
|
999
|
+
raise AttributeError(f"Unknown direction: {direction}")
|
|
1000
|
+
|
|
1001
|
+
dt = self.__keytransform__(target_date or datetime.now().date())
|
|
1002
|
+
if direction == "forward" and (next_year := dt.year + 1) not in self.years:
|
|
1003
|
+
self._populate(next_year)
|
|
1004
|
+
elif direction == "backward" and (previous_year := dt.year - 1) not in self.years:
|
|
1005
|
+
self._populate(previous_year)
|
|
1006
|
+
|
|
1007
|
+
sorted_dates = sorted(self.keys())
|
|
1008
|
+
position = (
|
|
1009
|
+
bisect_right(sorted_dates, dt)
|
|
1010
|
+
if direction == "forward"
|
|
1011
|
+
else bisect_left(sorted_dates, dt) - 1
|
|
1012
|
+
)
|
|
1013
|
+
if 0 <= position < len(sorted_dates):
|
|
1014
|
+
dt = sorted_dates[position]
|
|
1015
|
+
return dt, self[dt]
|
|
1016
|
+
|
|
1017
|
+
return None
|
|
1018
|
+
|
|
970
1019
|
def get_nth_working_day(self, key: DateLike, n: int) -> date:
|
|
971
1020
|
"""Return n-th working day from provided date (if n is positive)
|
|
972
1021
|
or n-th working day before provided date (if n is negative).
|
|
@@ -1201,4 +1250,4 @@ country_holidays('CA') + country_holidays('MX')
|
|
|
1201
1250
|
def _populate(self, year):
|
|
1202
1251
|
for operand in self.holidays:
|
|
1203
1252
|
operand._populate(year)
|
|
1204
|
-
self.update(cast("
|
|
1253
|
+
self.update(cast("dict[DateLike, str]", operand))
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
holidays/registry.py
CHANGED
|
@@ -142,6 +142,7 @@ COUNTRIES: RegistryDict = {
|
|
|
142
142
|
"romania": ("Romania", "RO", "ROU"),
|
|
143
143
|
"russia": ("Russia", "RU", "RUS"),
|
|
144
144
|
"saint_kitts_and_nevis": ("SaintKittsAndNevis", "KN", "KNA"),
|
|
145
|
+
"saint_lucia": ("SaintLucia", "LC", "LCA"),
|
|
145
146
|
"samoa": ("Samoa", "WS", "WSM"),
|
|
146
147
|
"san_marino": ("SanMarino", "SM", "SMR"),
|
|
147
148
|
"saudi_arabia": ("SaudiArabia", "SA", "SAU"),
|
|
@@ -163,6 +164,7 @@ COUNTRIES: RegistryDict = {
|
|
|
163
164
|
"tonga": ("Tonga", "TO", "TON"),
|
|
164
165
|
"tunisia": ("Tunisia", "TN", "TUN"),
|
|
165
166
|
"turkey": ("Turkey", "TR", "TUR"),
|
|
167
|
+
"tuvalu": ("Tuvalu", "TV", "TUV"),
|
|
166
168
|
"ukraine": ("Ukraine", "UA", "UKR"),
|
|
167
169
|
"united_arab_emirates": ("UnitedArabEmirates", "AE", "ARE"),
|
|
168
170
|
"united_kingdom": ("UnitedKingdom", "GB", "GBR", "UK"),
|
holidays/version.py
CHANGED