holidays 0.83__py3-none-any.whl → 0.84__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.
Files changed (64) hide show
  1. holidays/calendars/balinese_saka.py +2 -3
  2. holidays/calendars/buddhist.py +3 -4
  3. holidays/calendars/burmese.py +9 -10
  4. holidays/calendars/chinese.py +8 -9
  5. holidays/calendars/hebrew.py +10 -11
  6. holidays/calendars/hindu.py +27 -28
  7. holidays/calendars/mandaean.py +2 -3
  8. holidays/calendars/mongolian.py +4 -5
  9. holidays/calendars/persian.py +2 -3
  10. holidays/calendars/sinhala.py +25 -14
  11. holidays/calendars/thai.py +13 -14
  12. holidays/calendars/tibetan.py +12 -13
  13. holidays/countries/angola.py +1 -2
  14. holidays/countries/austria.py +1 -1
  15. holidays/countries/guernsey.py +1 -2
  16. holidays/countries/italy.py +2 -2
  17. holidays/countries/jersey.py +1 -2
  18. holidays/countries/malta.py +1 -1
  19. holidays/countries/portugal.py +6 -3
  20. holidays/countries/sint_maarten.py +1 -1
  21. holidays/countries/spain.py +418 -214
  22. holidays/countries/sri_lanka.py +37 -33
  23. holidays/countries/taiwan.py +2 -2
  24. holidays/countries/united_kingdom.py +1 -2
  25. holidays/countries/united_states.py +1 -2
  26. holidays/groups/balinese_saka.py +2 -3
  27. holidays/groups/buddhist.py +4 -5
  28. holidays/groups/burmese.py +11 -12
  29. holidays/groups/chinese.py +18 -19
  30. holidays/groups/christian.py +20 -0
  31. holidays/groups/eastern.py +2 -3
  32. holidays/groups/hebrew.py +7 -10
  33. holidays/groups/hindu.py +36 -37
  34. holidays/groups/mandaean.py +13 -14
  35. holidays/groups/mongolian.py +7 -8
  36. holidays/groups/persian.py +14 -15
  37. holidays/groups/sinhala.py +13 -14
  38. holidays/groups/thai.py +12 -13
  39. holidays/groups/tibetan.py +16 -17
  40. holidays/holiday_base.py +34 -33
  41. holidays/ical.py +1 -2
  42. holidays/locale/ca/LC_MESSAGES/ES.mo +0 -0
  43. holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
  44. holidays/locale/en_US/LC_MESSAGES/LK.mo +0 -0
  45. holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
  46. holidays/locale/si_LK/LC_MESSAGES/LK.mo +0 -0
  47. holidays/locale/ta_LK/LC_MESSAGES/LK.mo +0 -0
  48. holidays/locale/th/LC_MESSAGES/CN.mo +0 -0
  49. holidays/locale/th/LC_MESSAGES/ES.mo +0 -0
  50. holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
  51. holidays/locale/th/LC_MESSAGES/KR.mo +0 -0
  52. holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
  53. holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
  54. holidays/mixins/child_entity.py +1 -3
  55. holidays/observed_holiday_base.py +12 -13
  56. holidays/registry.py +3 -3
  57. holidays/utils.py +13 -14
  58. holidays/version.py +1 -1
  59. {holidays-0.83.dist-info → holidays-0.84.dist-info}/METADATA +3 -4
  60. {holidays-0.83.dist-info → holidays-0.84.dist-info}/RECORD +64 -63
  61. {holidays-0.83.dist-info → holidays-0.84.dist-info}/WHEEL +0 -0
  62. {holidays-0.83.dist-info → holidays-0.84.dist-info}/licenses/CONTRIBUTORS +0 -0
  63. {holidays-0.83.dist-info → holidays-0.84.dist-info}/licenses/LICENSE +0 -0
  64. {holidays-0.83.dist-info → holidays-0.84.dist-info}/top_level.txt +0 -0
@@ -12,7 +12,6 @@
12
12
 
13
13
  from datetime import date
14
14
  from functools import cache
15
- from typing import Optional
16
15
 
17
16
  from holidays.calendars.gregorian import _timedelta
18
17
 
@@ -296,7 +295,7 @@ class _ThaiLunisolar:
296
295
  )
297
296
 
298
297
  @cache
299
- def _get_start_date(self, year: int) -> Optional[date]:
298
+ def _get_start_date(self, year: int) -> date | None:
300
299
  """Calculate the start date of that particular Thai Lunar Calendar Year.
301
300
 
302
301
  This usually falls in November or December of the previous Gregorian
@@ -367,7 +366,7 @@ class _ThaiLunisolar:
367
366
 
368
367
  return buddhist_sabbaths
369
368
 
370
- def makha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
369
+ def makha_bucha_date(self, year: int, calendar=None) -> date | None:
371
370
  """Calculate the estimated Gregorian date of Makha Bucha.
372
371
 
373
372
  Also known as "Magha Puja", "Makha Buxha" and "Meak Bochea".
@@ -415,7 +414,7 @@ class _ThaiLunisolar:
415
414
  else +73,
416
415
  )
417
416
 
418
- def visakha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
417
+ def visakha_bucha_date(self, year: int, calendar=None) -> date | None:
419
418
  """Calculate the estimated Gregorian date of Visakha Bucha.
420
419
 
421
420
  Also known as "Vesak" and "Buddha Day". This coincides with
@@ -462,7 +461,7 @@ class _ThaiLunisolar:
462
461
  else +161,
463
462
  )
464
463
 
465
- def preah_neangkoal_date(self, year: int) -> Optional[date]:
464
+ def preah_neangkoal_date(self, year: int) -> date | None:
466
465
  """Calculate the estimated Gregorian date of Preah Neangkoal.
467
466
 
468
467
  Also known as "Cambodian Royal Ploughing Ceremony". This always
@@ -494,7 +493,7 @@ class _ThaiLunisolar:
494
493
 
495
494
  return _timedelta(start_date, +165)
496
495
 
497
- def atthami_bucha_date(self, year: int, calendar=None) -> Optional[date]:
496
+ def atthami_bucha_date(self, year: int, calendar=None) -> date | None:
498
497
  """Calculate the estimated Gregorian date of Atthami Bucha.
499
498
 
500
499
  Also known as "Buddha's Cremation Day". This coincides with
@@ -543,7 +542,7 @@ class _ThaiLunisolar:
543
542
  else +169,
544
543
  )
545
544
 
546
- def asarnha_bucha_date(self, year: int) -> Optional[date]:
545
+ def asarnha_bucha_date(self, year: int) -> date | None:
547
546
  """Calculate the estimated Gregorian date of Asarnha Bucha.
548
547
 
549
548
  Also known as "Asalha Puja". This coincides with
@@ -583,7 +582,7 @@ class _ThaiLunisolar:
583
582
  delta_days = +220
584
583
  return _timedelta(start_date, delta_days)
585
584
 
586
- def khao_phansa_date(self, year: int) -> Optional[date]:
585
+ def khao_phansa_date(self, year: int) -> date | None:
587
586
  """Calculate the estimated Gregorian date of Khao Phansa.
588
587
 
589
588
  Also known as "(Start of) Buddhist Lent" and "Start of Vassa".
@@ -623,7 +622,7 @@ class _ThaiLunisolar:
623
622
  delta_days = +221
624
623
  return _timedelta(start_date, delta_days)
625
624
 
626
- def boun_haw_khao_padapdin_date(self, year: int) -> Optional[date]:
625
+ def boun_haw_khao_padapdin_date(self, year: int) -> date | None:
627
626
  """Calculate the estimated Gregorian date of Boun Haw Khao Padapdin.
628
627
 
629
628
  Also known as "Boon Khao Padap Din".
@@ -660,7 +659,7 @@ class _ThaiLunisolar:
660
659
  delta_days = +264
661
660
  return _timedelta(start_date, delta_days)
662
661
 
663
- def boun_haw_khao_salark_date(self, year: int) -> Optional[date]:
662
+ def boun_haw_khao_salark_date(self, year: int) -> date | None:
664
663
  """Calculate the estimated Gregorian date of Boun Haw Khao Salark.
665
664
 
666
665
  Also known as "Boon Khao Sak".
@@ -697,7 +696,7 @@ class _ThaiLunisolar:
697
696
  delta_days = +279
698
697
  return _timedelta(start_date, delta_days)
699
698
 
700
- def pchum_ben_date(self, year: int) -> Optional[date]:
699
+ def pchum_ben_date(self, year: int) -> date | None:
701
700
  """Calculate the estimated Gregorian date of Pchum Ben.
702
701
 
703
702
  Also known as "Prachum Bandar".
@@ -734,7 +733,7 @@ class _ThaiLunisolar:
734
733
  delta_days = +294
735
734
  return _timedelta(start_date, delta_days)
736
735
 
737
- def ok_phansa_date(self, year: int) -> Optional[date]:
736
+ def ok_phansa_date(self, year: int) -> date | None:
738
737
  """Calculate the estimated Gregorian date of Ok Phansa.
739
738
 
740
739
  Also known as "End of Buddhist Lent" and "End of Vassa".
@@ -771,7 +770,7 @@ class _ThaiLunisolar:
771
770
  delta_days = +309
772
771
  return _timedelta(start_date, delta_days)
773
772
 
774
- def boun_suang_heua_date(self, year: int) -> Optional[date]:
773
+ def boun_suang_heua_date(self, year: int) -> date | None:
775
774
  """Calculate the estimated Gregorian date of Ok Boun Suang Huea.
776
775
 
777
776
  Boun Suang Huea Nakhone Luang Prabang, also known as "Vientiane Boat Racing Festival".
@@ -808,7 +807,7 @@ class _ThaiLunisolar:
808
807
  delta_days = +310
809
808
  return _timedelta(start_date, delta_days)
810
809
 
811
- def loy_krathong_date(self, year: int) -> Optional[date]:
810
+ def loy_krathong_date(self, year: int) -> date | None:
812
811
  """Calculate the estimated Gregorian date of Loy Krathong.
813
812
 
814
813
  Also known as "Boun That Louang" and "Bon Om Touk".
@@ -11,7 +11,6 @@
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
13
  from datetime import date
14
- from typing import Optional
15
14
 
16
15
  from holidays.calendars.custom import _CustomCalendar
17
16
  from holidays.calendars.gregorian import JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV
@@ -1422,43 +1421,43 @@ class _TibetanLunisolar:
1422
1421
  2099: (JAN, 2),
1423
1422
  }
1424
1423
 
1425
- def _get_holiday(self, holiday: str, year: int) -> tuple[Optional[date], bool]:
1424
+ def _get_holiday(self, holiday: str, year: int) -> tuple[date | None, bool]:
1426
1425
  estimated_dates = getattr(self, f"{holiday}_DATES", {})
1427
1426
  exact_dates = getattr(self, f"{holiday}_DATES_{_CustomCalendar.CUSTOM_ATTR_POSTFIX}", {})
1428
1427
  dt = exact_dates.get(year, estimated_dates.get(year, ()))
1429
1428
  return date(year, *dt) if dt else None, year not in exact_dates
1430
1429
 
1431
- def blessed_rainy_day_date(self, year: int) -> tuple[Optional[date], bool]:
1430
+ def blessed_rainy_day_date(self, year: int) -> tuple[date | None, bool]:
1432
1431
  return self._get_holiday(BLESSED_RAINY_DAY, year)
1433
1432
 
1434
- def birth_of_guru_rinpoche_date(self, year: int) -> tuple[Optional[date], bool]:
1433
+ def birth_of_guru_rinpoche_date(self, year: int) -> tuple[date | None, bool]:
1435
1434
  return self._get_holiday(BIRTH_OF_GURU_RINPOCHE, year)
1436
1435
 
1437
- def buddha_first_sermon_date(self, year: int) -> tuple[Optional[date], bool]:
1436
+ def buddha_first_sermon_date(self, year: int) -> tuple[date | None, bool]:
1438
1437
  return self._get_holiday(BUDDHA_FIRST_SERMON, year)
1439
1438
 
1440
- def buddha_parinirvana_date(self, year: int) -> tuple[Optional[date], bool]:
1439
+ def buddha_parinirvana_date(self, year: int) -> tuple[date | None, bool]:
1441
1440
  return self._get_holiday(BUDDHA_PARINIRVANA, year)
1442
1441
 
1443
- def day_of_offering_date(self, year: int) -> tuple[Optional[date], bool]:
1442
+ def day_of_offering_date(self, year: int) -> tuple[date | None, bool]:
1444
1443
  return self._get_holiday(DAY_OF_OFFERING, year)
1445
1444
 
1446
- def death_of_zhabdrung_date(self, year: int) -> tuple[Optional[date], bool]:
1445
+ def death_of_zhabdrung_date(self, year: int) -> tuple[date | None, bool]:
1447
1446
  return self._get_holiday(DEATH_OF_ZHABDRUNG, year)
1448
1447
 
1449
- def descending_day_of_lord_buddha_date(self, year: int) -> tuple[Optional[date], bool]:
1448
+ def descending_day_of_lord_buddha_date(self, year: int) -> tuple[date | None, bool]:
1450
1449
  return self._get_holiday(DESCENDING_DAY_OF_LORD_BUDDHA, year)
1451
1450
 
1452
- def losar_date(self, year: int) -> tuple[Optional[date], bool]:
1451
+ def losar_date(self, year: int) -> tuple[date | None, bool]:
1453
1452
  return self._get_holiday(LOSAR, year)
1454
1453
 
1455
- def thimphu_drubchen_date(self, year: int) -> tuple[Optional[date], bool]:
1454
+ def thimphu_drubchen_date(self, year: int) -> tuple[date | None, bool]:
1456
1455
  return self._get_holiday(THIMPHU_DRUBCHEN, year)
1457
1456
 
1458
- def thimphu_tshechu_date(self, year: int) -> tuple[Optional[date], bool]:
1457
+ def thimphu_tshechu_date(self, year: int) -> tuple[date | None, bool]:
1459
1458
  return self._get_holiday(THIMPHU_TSHECHU, year)
1460
1459
 
1461
- def tibetan_winter_solstice_date(self, year: int) -> tuple[Optional[date], bool]:
1460
+ def tibetan_winter_solstice_date(self, year: int) -> tuple[date | None, bool]:
1462
1461
  return self._get_holiday(WINTER_SOLSTICE, year)
1463
1462
 
1464
1463
 
@@ -12,7 +12,6 @@
12
12
 
13
13
  from datetime import date
14
14
  from gettext import gettext as tr
15
- from typing import Optional
16
15
 
17
16
  from holidays.calendars.gregorian import AUG, SEP
18
17
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
@@ -62,7 +61,7 @@ class Angola(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
62
61
  # it rolls over to the following Monday.
63
62
  return dt >= date(1996, SEP, 27)
64
63
 
65
- def _add_observed(self, dt: date, **kwargs) -> tuple[bool, Optional[date]]:
64
+ def _add_observed(self, dt: date, **kwargs) -> tuple[bool, date | None]:
66
65
  # As per Law # #11/18, from 2018/9/10, when public holiday falls on Tuesday or Thursday,
67
66
  # the Monday or Friday is also a holiday.
68
67
  kwargs.setdefault(
@@ -124,7 +124,7 @@ class Austria(HolidayBase, ChristianHolidays, InternationalHolidays):
124
124
 
125
125
  def _populate_subdiv_1_bank_holidays(self):
126
126
  # Saint Martin's Day.
127
- self._add_holiday_nov_11(tr("Hl. Martin"))
127
+ self._add_saint_martins_day(tr("Hl. Martin"))
128
128
 
129
129
  def _populate_subdiv_2_bank_holidays(self):
130
130
  # Saint Joseph's Day.
@@ -11,7 +11,6 @@
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
13
  from datetime import date
14
- from typing import Optional
15
14
 
16
15
  from holidays.calendars.gregorian import JAN, APR, MAY, JUN, JUL, SEP, OCT, DEC
17
16
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
@@ -53,7 +52,7 @@ class Guernsey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St
53
52
  kwargs.setdefault("observed_since", 1955)
54
53
  ObservedHolidayBase.__init__(self, *args, **kwargs)
55
54
 
56
- def _add_observed(self, dt: date, **kwargs) -> tuple[bool, Optional[date]]:
55
+ def _add_observed(self, dt: date, **kwargs) -> tuple[bool, date | None]:
57
56
  # Prior to 2009, in-lieu are only given for Sundays.
58
57
  # https://web.archive.org/web/20230930101652/https://guernseylegalresources.gg/CHttpHandler.ashx?documentid=55179
59
58
  kwargs.setdefault(
@@ -357,7 +357,7 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHoliday
357
357
  self._add_christmas_day_two("Santo Stefano")
358
358
 
359
359
  def _populate_subdiv_bl_public_holidays(self):
360
- self._add_holiday_nov_11("San Martino")
360
+ self._add_saint_martins_day("San Martino")
361
361
 
362
362
  def _populate_subdiv_bn_public_holidays(self):
363
363
  self._add_holiday_aug_24("San Bartolomeo apostolo")
@@ -518,7 +518,7 @@ class Italy(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHoliday
518
518
  self._add_holiday_jul_4("Sant'Antonino di Piacenza")
519
519
 
520
520
  def _populate_subdiv_pd_public_holidays(self):
521
- self._add_holiday_jun_13("Sant'Antonio di Padova")
521
+ self._add_saint_anthonys_day("Sant'Antonio di Padova")
522
522
 
523
523
  def _populate_subdiv_pe_public_holidays(self):
524
524
  self._add_holiday_oct_10("San Cetteo")
@@ -11,7 +11,6 @@
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
13
  from datetime import date
14
- from typing import Optional
15
14
 
16
15
  from holidays.calendars.gregorian import JAN, APR, MAY, JUN, JUL, SEP, OCT, DEC
17
16
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
@@ -60,7 +59,7 @@ class Jersey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
60
59
  kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_WORKDAY)
61
60
  ObservedHolidayBase.__init__(self, *args, **kwargs)
62
61
 
63
- def _add_observed(self, dt: date, **kwargs) -> tuple[bool, Optional[date]]:
62
+ def _add_observed(self, dt: date, **kwargs) -> tuple[bool, date | None]:
64
63
  # Prior to 2004, in-lieu are only given for Sundays.
65
64
  # https://web.archive.org/web/20250414072718/https://www.jerseylaw.je/laws/enacted/Pages/RO-123-2004.aspx
66
65
  kwargs.setdefault(
@@ -112,7 +112,7 @@ class Malta(HolidayBase, ChristianHolidays, InternationalHolidays):
112
112
 
113
113
  if self._year >= 1987:
114
114
  # Feast of Our Lady of Victories.
115
- self._add_holiday_sep_8(tr("Jum il-Vitorja"))
115
+ self._add_nativity_of_mary_day(tr("Jum il-Vitorja"))
116
116
 
117
117
  # Jum l-Indipendenza
118
118
  # Status: In-Use.
@@ -166,7 +166,7 @@ class Portugal(HolidayBase, ChristianHolidays, InternationalHolidays):
166
166
  self._add_carnival_tuesday(tr("Carnaval"))
167
167
 
168
168
  # Saint Anthony's Day.
169
- self._add_holiday_jun_13(tr("Dia de Santo António"))
169
+ self._add_saint_anthonys_day(tr("Dia de Santo António"))
170
170
 
171
171
  # Christmas Eve.
172
172
  self._add_christmas_eve(tr("Véspera de Natal"))
@@ -225,13 +225,15 @@ class Portugal(HolidayBase, ChristianHolidays, InternationalHolidays):
225
225
  self._add_holiday_may_22(tr("Dia do Município de Leiria"))
226
226
 
227
227
  def _populate_subdiv_11_public_holidays(self):
228
- self._add_holiday_jun_13(tr("Dia de Santo António"))
228
+ # Saint Anthony's Day.
229
+ self._add_saint_anthonys_day(tr("Dia de Santo António"))
229
230
 
230
231
  def _populate_subdiv_12_public_holidays(self):
231
232
  # Municipal Holiday of Portalegre.
232
233
  self._add_holiday_may_23(tr("Dia do Município de Portalegre"))
233
234
 
234
235
  def _populate_subdiv_13_public_holidays(self):
236
+ # Saint John's Day.
235
237
  self._add_saint_johns_day(tr("Dia de São João"))
236
238
 
237
239
  def _populate_subdiv_14_public_holidays(self):
@@ -247,7 +249,8 @@ class Portugal(HolidayBase, ChristianHolidays, InternationalHolidays):
247
249
  self._add_holiday_aug_20(tr("Dia de Nossa Senhora da Agonia"))
248
250
 
249
251
  def _populate_subdiv_17_public_holidays(self):
250
- self._add_holiday_jun_13(tr("Dia de Santo António"))
252
+ # Saint Anthony's Day.
253
+ self._add_saint_anthonys_day(tr("Dia de Santo António"))
251
254
 
252
255
  def _populate_subdiv_18_public_holidays(self):
253
256
  # Saint Matthew's Day.
@@ -96,7 +96,7 @@ class SintMaarten(ObservedHolidayBase, ChristianHolidays, InternationalHolidays)
96
96
  self._add_holiday_2nd_mon_of_oct(tr("Dag van de Constitutie"))
97
97
 
98
98
  # Sint Maarten Day.
99
- self._add_holiday_nov_11(tr("Sint-Maartensdag"))
99
+ self._add_saint_martins_day(tr("Sint-Maartensdag"))
100
100
 
101
101
  # Replaced by Constitution Day on October 2nd, 2015.
102
102
  if self._year <= 2014: