holidays 0.78__py3-none-any.whl → 0.80__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 (161) hide show
  1. holidays/calendars/__init__.py +1 -0
  2. holidays/calendars/chinese.py +14 -4
  3. holidays/calendars/ethiopian.py +31 -0
  4. holidays/calendars/hindu.py +1 -0
  5. holidays/calendars/islamic.py +16 -4
  6. holidays/calendars/julian.py +14 -0
  7. holidays/calendars/mandaean.py +59 -0
  8. holidays/calendars/tibetan.py +1466 -0
  9. holidays/constants.py +2 -1
  10. holidays/countries/__init__.py +20 -0
  11. holidays/countries/afghanistan.py +6 -39
  12. holidays/countries/albania.py +3 -22
  13. holidays/countries/argentina.py +7 -18
  14. holidays/countries/australia.py +191 -295
  15. holidays/countries/azerbaijan.py +6 -39
  16. holidays/countries/bahrain.py +29 -38
  17. holidays/countries/bhutan.py +194 -0
  18. holidays/countries/bosnia_and_herzegovina.py +7 -28
  19. holidays/countries/brunei.py +7 -117
  20. holidays/countries/burkina_faso.py +9 -15
  21. holidays/countries/burundi.py +95 -40
  22. holidays/countries/cameroon.py +8 -34
  23. holidays/countries/canada.py +9 -1
  24. holidays/countries/central_african_republic.py +3 -16
  25. holidays/countries/chad.py +9 -17
  26. holidays/countries/chile.py +20 -4
  27. holidays/countries/christmas_island.py +10 -15
  28. holidays/countries/cocos_islands.py +5 -24
  29. holidays/countries/comoros.py +121 -0
  30. holidays/countries/egypt.py +5 -37
  31. holidays/countries/eritrea.py +104 -0
  32. holidays/countries/ethiopia.py +18 -47
  33. holidays/countries/fiji.py +1 -2
  34. holidays/countries/gabon.py +5 -23
  35. holidays/countries/gambia.py +168 -0
  36. holidays/countries/georgia.py +9 -7
  37. holidays/countries/guinea.py +5 -27
  38. holidays/countries/guinea_bissau.py +96 -0
  39. holidays/countries/guyana.py +2 -17
  40. holidays/countries/india.py +12 -25
  41. holidays/countries/indonesia.py +6 -158
  42. holidays/countries/iran.py +16 -126
  43. holidays/countries/iraq.py +276 -0
  44. holidays/countries/kazakhstan.py +2 -18
  45. holidays/countries/kenya.py +2 -8
  46. holidays/countries/kiribati.py +124 -0
  47. holidays/countries/kyrgyzstan.py +2 -0
  48. holidays/countries/lebanon.py +5 -87
  49. holidays/countries/liberia.py +80 -0
  50. holidays/countries/libya.py +5 -37
  51. holidays/countries/macau.py +65 -63
  52. holidays/countries/malaysia.py +9 -130
  53. holidays/countries/maldives.py +2 -0
  54. holidays/countries/mali.py +4 -9
  55. holidays/countries/mauritania.py +2 -0
  56. holidays/countries/mauritius.py +1 -2
  57. holidays/countries/montenegro.py +3 -18
  58. holidays/countries/nepal.py +42 -44
  59. holidays/countries/niger.py +14 -74
  60. holidays/countries/nigeria.py +198 -27
  61. holidays/countries/north_macedonia.py +3 -39
  62. holidays/countries/oman.py +6 -28
  63. holidays/countries/pakistan.py +5 -30
  64. holidays/countries/palestine.py +2 -5
  65. holidays/countries/philippines.py +3 -33
  66. holidays/countries/qatar.py +3 -45
  67. holidays/countries/rwanda.py +162 -0
  68. holidays/countries/saudi_arabia.py +3 -0
  69. holidays/countries/senegal.py +6 -16
  70. holidays/countries/sierra_leone.py +5 -21
  71. holidays/countries/singapore.py +7 -59
  72. holidays/countries/somalia.py +79 -0
  73. holidays/countries/south_georgia_and_the_south_sandwich_islands.py +160 -0
  74. holidays/countries/south_sudan.py +133 -0
  75. holidays/countries/spain.py +7 -10
  76. holidays/countries/sri_lanka.py +3 -14
  77. holidays/countries/suriname.py +11 -19
  78. holidays/countries/syrian_arab_republic.py +134 -0
  79. holidays/countries/tajikistan.py +116 -0
  80. holidays/countries/tanzania.py +291 -153
  81. holidays/countries/timor_leste.py +2 -17
  82. holidays/countries/togo.py +4 -29
  83. holidays/countries/trinidad_and_tobago.py +2 -9
  84. holidays/countries/turkey.py +2 -116
  85. holidays/countries/turkmenistan.py +164 -0
  86. holidays/countries/uganda.py +101 -0
  87. holidays/countries/united_arab_emirates.py +5 -29
  88. holidays/countries/uzbekistan.py +3 -31
  89. holidays/countries/yemen.py +8 -52
  90. holidays/financial/__init__.py +5 -0
  91. holidays/financial/national_stock_exchange_of_india.py +169 -0
  92. holidays/groups/__init__.py +2 -0
  93. holidays/groups/christian.py +48 -12
  94. holidays/groups/eastern.py +1 -1
  95. holidays/groups/international.py +17 -1
  96. holidays/groups/islamic.py +1 -1
  97. holidays/groups/mandaean.py +107 -0
  98. holidays/groups/tibetan.py +153 -0
  99. holidays/holiday_base.py +14 -0
  100. holidays/locale/ar/LC_MESSAGES/BH.mo +0 -0
  101. holidays/locale/ar/LC_MESSAGES/IQ.mo +0 -0
  102. holidays/locale/ar/LC_MESSAGES/SY.mo +0 -0
  103. holidays/locale/bs/LC_MESSAGES/BA.mo +0 -0
  104. holidays/locale/en_GM/LC_MESSAGES/GM.mo +0 -0
  105. holidays/locale/en_GS/LC_MESSAGES/GS.mo +0 -0
  106. holidays/locale/en_IN/LC_MESSAGES/XNSE.mo +0 -0
  107. holidays/locale/en_MO/LC_MESSAGES/MO.mo +0 -0
  108. holidays/locale/en_NG/LC_MESSAGES/NG.mo +0 -0
  109. holidays/locale/en_SG/LC_MESSAGES/SG.mo +0 -0
  110. holidays/locale/en_US/LC_MESSAGES/AR.mo +0 -0
  111. holidays/locale/en_US/LC_MESSAGES/BA.mo +0 -0
  112. holidays/locale/en_US/LC_MESSAGES/BH.mo +0 -0
  113. holidays/locale/en_US/LC_MESSAGES/BI.mo +0 -0
  114. holidays/locale/en_US/LC_MESSAGES/CL.mo +0 -0
  115. holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
  116. holidays/locale/en_US/LC_MESSAGES/GE.mo +0 -0
  117. holidays/locale/en_US/LC_MESSAGES/GM.mo +0 -0
  118. holidays/locale/en_US/LC_MESSAGES/GS.mo +0 -0
  119. holidays/locale/en_US/LC_MESSAGES/GW.mo +0 -0
  120. holidays/locale/en_US/LC_MESSAGES/IQ.mo +0 -0
  121. holidays/locale/en_US/LC_MESSAGES/MO.mo +0 -0
  122. holidays/locale/en_US/LC_MESSAGES/NG.mo +0 -0
  123. holidays/locale/en_US/LC_MESSAGES/RW.mo +0 -0
  124. holidays/locale/en_US/LC_MESSAGES/SG.mo +0 -0
  125. holidays/locale/en_US/LC_MESSAGES/SY.mo +0 -0
  126. holidays/locale/en_US/LC_MESSAGES/TJ.mo +0 -0
  127. holidays/locale/en_US/LC_MESSAGES/TM.mo +0 -0
  128. holidays/locale/en_US/LC_MESSAGES/TZ.mo +0 -0
  129. holidays/locale/en_US/LC_MESSAGES/XNSE.mo +0 -0
  130. holidays/locale/es/LC_MESSAGES/AR.mo +0 -0
  131. holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
  132. holidays/locale/fr/LC_MESSAGES/RW.mo +0 -0
  133. holidays/locale/fr_BI/LC_MESSAGES/BI.mo +0 -0
  134. holidays/locale/hi/LC_MESSAGES/XNSE.mo +0 -0
  135. holidays/locale/ka/LC_MESSAGES/GE.mo +0 -0
  136. holidays/locale/pt_GW/LC_MESSAGES/GW.mo +0 -0
  137. holidays/locale/pt_MO/LC_MESSAGES/MO.mo +0 -0
  138. holidays/locale/ru/LC_MESSAGES/TJ.mo +0 -0
  139. holidays/locale/ru/LC_MESSAGES/TM.mo +0 -0
  140. holidays/locale/rw/LC_MESSAGES/RW.mo +0 -0
  141. holidays/locale/sr/LC_MESSAGES/BA.mo +0 -0
  142. holidays/locale/sw/LC_MESSAGES/TZ.mo +0 -0
  143. holidays/locale/tg/LC_MESSAGES/TJ.mo +0 -0
  144. holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
  145. holidays/locale/th/LC_MESSAGES/SG.mo +0 -0
  146. holidays/locale/tk/LC_MESSAGES/TM.mo +0 -0
  147. holidays/locale/uk/LC_MESSAGES/AR.mo +0 -0
  148. holidays/locale/uk/LC_MESSAGES/BA.mo +0 -0
  149. holidays/locale/uk/LC_MESSAGES/CL.mo +0 -0
  150. holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
  151. holidays/locale/uk/LC_MESSAGES/GE.mo +0 -0
  152. holidays/locale/zh_CN/LC_MESSAGES/MO.mo +0 -0
  153. holidays/locale/zh_MO/LC_MESSAGES/MO.mo +0 -0
  154. holidays/registry.py +46 -14
  155. holidays/version.py +1 -1
  156. {holidays-0.78.dist-info → holidays-0.80.dist-info}/METADATA +127 -9
  157. {holidays-0.78.dist-info → holidays-0.80.dist-info}/RECORD +161 -113
  158. {holidays-0.78.dist-info → holidays-0.80.dist-info}/licenses/CONTRIBUTORS +2 -0
  159. {holidays-0.78.dist-info → holidays-0.80.dist-info}/WHEEL +0 -0
  160. {holidays-0.78.dist-info → holidays-0.80.dist-info}/licenses/LICENSE +0 -0
  161. {holidays-0.78.dist-info → holidays-0.80.dist-info}/top_level.txt +0 -0
@@ -13,22 +13,7 @@
13
13
  from gettext import gettext as tr
14
14
 
15
15
  from holidays.calendars import _CustomIslamicHolidays
16
- from holidays.calendars.gregorian import (
17
- JAN,
18
- FEB,
19
- MAR,
20
- APR,
21
- MAY,
22
- JUN,
23
- JUL,
24
- AUG,
25
- SEP,
26
- OCT,
27
- THU,
28
- FRI,
29
- SAT,
30
- _timedelta,
31
- )
16
+ from holidays.calendars.gregorian import AUG, THU, FRI, SAT, _timedelta
32
17
  from holidays.constants import PUBLIC, SCHOOL, WORKDAY
33
18
  from holidays.groups import InternationalHolidays, IslamicHolidays
34
19
  from holidays.observed_holiday_base import ObservedHolidayBase, FRI_TO_NEXT_WORKDAY
@@ -156,52 +141,23 @@ class YEM(Yemen):
156
141
 
157
142
  class YemenIslamicHolidays(_CustomIslamicHolidays):
158
143
  # https://web.archive.org/web/20250115070635/https://www.timeanddate.com/holidays/yemen/eid-al-adha-first-day
159
- EID_AL_ADHA_DATES = {
160
- 2020: (JUL, 31),
161
- 2021: (JUL, 20),
162
- 2022: (JUL, 9),
163
- 2023: (JUN, 28),
164
- 2024: (JUN, 16),
165
- }
144
+
145
+ EID_AL_ADHA_DATES_CONFIRMED_YEARS = (2020, 2024)
166
146
 
167
147
  # https://web.archive.org/web/20250218061345/https://www.timeanddate.com/holidays/yemen/eid-al-fitr-first-day
168
- EID_AL_FITR_DATES = {
169
- 2020: (MAY, 24),
170
- 2021: (MAY, 13),
171
- 2022: (MAY, 2),
172
- 2023: (APR, 21),
173
- 2024: (APR, 10),
174
- 2025: (MAR, 30),
175
- }
148
+ EID_AL_FITR_DATES_CONFIRMED_YEARS = (2020, 2025)
176
149
 
177
150
  # https://web.archive.org/web/20241011200213/https://www.timeanddate.com/holidays/yemen/muharram-new-year
151
+ HIJRI_NEW_YEAR_DATES_CONFIRMED_YEARS = (2020, 2024)
178
152
  HIJRI_NEW_YEAR_DATES = {
179
- 2020: (AUG, 20),
180
153
  2021: (AUG, 10),
181
- 2022: (JUL, 30),
182
- 2023: (JUL, 19),
183
- 2024: (JUL, 7),
184
154
  }
185
155
 
186
156
  # https://web.archive.org/web/20241010083000/https://www.timeanddate.com/holidays/yemen/isra-miraj
187
- ISRA_AND_MIRAJ_DATES = {
188
- 2023: (FEB, 18),
189
- 2024: (FEB, 8),
190
- 2025: (JAN, 27),
191
- }
157
+ ISRA_AND_MIRAJ_DATES_CONFIRMED_YEARS = (2023, 2025)
192
158
 
193
159
  # https://web.archive.org/web/20241010222331/https://www.timeanddate.com/holidays/yemen/prophet-birthday
194
- MAWLID_DATES = {
195
- 2020: (OCT, 29),
196
- 2021: (OCT, 18),
197
- 2022: (OCT, 8),
198
- 2023: (SEP, 27),
199
- 2024: (SEP, 15),
200
- }
160
+ MAWLID_DATES_CONFIRMED_YEARS = (2020, 2024)
201
161
 
202
162
  # https://web.archive.org/web/20250119111122/https://www.timeanddate.com/holidays/yemen/ramadan-begins
203
- RAMADAN_BEGINNING_DATES = {
204
- 2023: (MAR, 23),
205
- 2024: (MAR, 11),
206
- 2025: (MAR, 1),
207
- }
163
+ RAMADAN_BEGINNING_DATES_CONFIRMED_YEARS = (2023, 2025)
@@ -15,4 +15,9 @@
15
15
  from holidays.financial.brasil_bolsa_balcao import BrasilBolsaBalcao, BVMF, B3
16
16
  from holidays.financial.european_central_bank import EuropeanCentralBank, XECB, ECB, TAR
17
17
  from holidays.financial.ice_futures_europe import ICEFuturesEurope, IFEU
18
+ from holidays.financial.national_stock_exchange_of_india import (
19
+ NationalStockExchangeOfIndia,
20
+ XNSE,
21
+ NSE,
22
+ )
18
23
  from holidays.financial.ny_stock_exchange import NewYorkStockExchange, XNYS, NYSE
@@ -0,0 +1,169 @@
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 <dr.prodigy.github@gmail.com> (c) 2017-2023
9
+ # ryanss <ryanssdev@icloud.com> (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 _CustomHinduHolidays, _CustomIslamicHolidays
16
+ from holidays.calendars.gregorian import MAR, APR, MAY, JUN, JUL, AUG
17
+ from holidays.groups import ChristianHolidays, HinduCalendarHolidays, IslamicHolidays
18
+ from holidays.observed_holiday_base import ObservedHolidayBase, SAT_TO_NONE, SUN_TO_NONE
19
+
20
+
21
+ class NationalStockExchangeOfIndia(
22
+ ObservedHolidayBase, HinduCalendarHolidays, ChristianHolidays, IslamicHolidays
23
+ ):
24
+ """National Stock Exchange of India (NSE) holidays.
25
+
26
+ References:
27
+ * <https://web.archive.org/web/20250821175252/https://www.nseindia.com/resources/exchange-communication-circulars>
28
+
29
+ Historical data:
30
+ * [2022](https://web.archive.org/web/20250821071611/https://nsearchives.nseindia.com/content/circulars/CMTR50560.pdf)
31
+ * [2023](https://web.archive.org/web/20250821071635/https://nsearchives.nseindia.com/content/circulars/CMTR54757.pdf)
32
+ * [2024](https://web.archive.org/web/20250821071650/https://nsearchives.nseindia.com/content/circulars/CMTR59722.pdf)
33
+ * [2025](https://web.archive.org/web/20250624132016/https://nsearchives.nseindia.com/content/circulars/CMTR65587.pdf)
34
+ """
35
+
36
+ market = "XNSE"
37
+ default_language = "en_IN"
38
+ # %s (estimated).
39
+ estimated_label = tr("%s (estimated)")
40
+ supported_languages = ("en_IN", "en_US", "hi")
41
+ start_year = 2001
42
+
43
+ def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
44
+ """
45
+ Args:
46
+ islamic_show_estimated:
47
+ Whether to add "estimated" label to Islamic holidays name
48
+ if holiday date is estimated.
49
+ """
50
+ ChristianHolidays.__init__(self)
51
+ HinduCalendarHolidays.__init__(self, cls=NationalStockExchangeOfIndiaHinduHolidays)
52
+ IslamicHolidays.__init__(
53
+ self,
54
+ cls=NationalStockExchangeOfIndiaIslamicHolidays,
55
+ show_estimated=islamic_show_estimated,
56
+ )
57
+ kwargs.setdefault("observed_rule", SAT_TO_NONE + SUN_TO_NONE)
58
+ super().__init__(*args, **kwargs)
59
+
60
+ def _populate_public_holidays(self):
61
+ # Republic Day.
62
+ self._move_holiday(self._add_holiday_jan_26(tr("Republic Day")))
63
+
64
+ # Good Friday.
65
+ self._add_good_friday(tr("Good Friday"))
66
+
67
+ # Dr. Baba Saheb Ambedkar Jayanti.
68
+ self._move_holiday(self._add_holiday_apr_14(tr("Dr. Baba Saheb Ambedkar Jayanti")))
69
+
70
+ # Maharashtra Day.
71
+ self._move_holiday(self._add_holiday_may_1(tr("Maharashtra Day")))
72
+
73
+ # Independence Day.
74
+ self._move_holiday(self._add_holiday_aug_15(tr("Independence Day")))
75
+
76
+ # Mahatma Gandhi Jayanti.
77
+ self._move_holiday(self._add_holiday_oct_2(tr("Mahatma Gandhi Jayanti")))
78
+
79
+ # Christmas Day.
80
+ self._move_holiday(self._add_christmas_day(tr("Christmas Day")))
81
+
82
+ # Hindu Calendar Holidays.
83
+
84
+ # Maha Shivaratri.
85
+ self._move_holiday(self._add_maha_shivaratri(tr("Maha Shivaratri")))
86
+
87
+ # Holi.
88
+ self._move_holiday(self._add_holi(tr("Holi")))
89
+
90
+ # Ram Navami.
91
+ self._move_holiday(self._add_ram_navami(tr("Ram Navami")))
92
+
93
+ # Mahavir Jayanti.
94
+ self._move_holiday(self._add_mahavir_jayanti(tr("Mahavir Jayanti")))
95
+
96
+ # Ganesh Chaturthi.
97
+ self._move_holiday(self._add_ganesh_chaturthi(tr("Ganesh Chaturthi")))
98
+
99
+ # Dussehra.
100
+ self._move_holiday(self._add_dussehra(tr("Dussehra")))
101
+
102
+ # Diwali Laxmi Pujan.
103
+ self._move_holiday(self._add_gau_krida(tr("Diwali Laxmi Pujan")))
104
+
105
+ # Diwali Balipratipada.
106
+ name = tr("Diwali Balipratipada")
107
+ # NSE's calendar adds an extra-day gap in 2022–2023
108
+ # between Diwali Laxmi Pujan and Diwali Balipratipada.
109
+ self._move_holiday(
110
+ self._add_bhai_dooj(name)
111
+ if self._year in {2022, 2023}
112
+ else self._add_govardhan_puja(name)
113
+ )
114
+
115
+ # Guru Nanak Jayanti.
116
+ self._move_holiday(self._add_guru_nanak_jayanti(tr("Guru Nanak Jayanti")))
117
+
118
+ # Islamic Calendar Holidays.
119
+
120
+ # Ashura.
121
+ for dt in self._add_ashura_day(tr("Muharram")):
122
+ self._move_holiday(dt)
123
+
124
+ # Eid al-Fitr.
125
+ for dt in self._add_eid_al_fitr_day(tr("Id-Ul-Fitr (Ramadan Eid)")):
126
+ self._move_holiday(dt)
127
+
128
+ # Eid al-Adha.
129
+ for dt in self._add_eid_al_adha_day(tr("Bakri Id")):
130
+ self._move_holiday(dt)
131
+
132
+
133
+ class XNSE(NationalStockExchangeOfIndia):
134
+ pass
135
+
136
+
137
+ class NSE(NationalStockExchangeOfIndia):
138
+ pass
139
+
140
+
141
+ class NationalStockExchangeOfIndiaHinduHolidays(_CustomHinduHolidays):
142
+ HOLI_DATES = {
143
+ 2023: (MAR, 7),
144
+ }
145
+
146
+
147
+ class NationalStockExchangeOfIndiaIslamicHolidays(_CustomIslamicHolidays):
148
+ ASHURA_DATES_CONFIRMED_YEARS = (2022, 2025)
149
+ ASHURA_DATES = {
150
+ 2022: (AUG, 9),
151
+ 2023: (JUL, 29),
152
+ 2024: (JUL, 17),
153
+ 2025: (JUL, 6),
154
+ }
155
+
156
+ EID_AL_ADHA_DATES_CONFIRMED_YEARS = (2022, 2025)
157
+ EID_AL_ADHA_DATES = {
158
+ 2022: (JUL, 10),
159
+ 2024: (JUN, 17),
160
+ 2025: (JUN, 7),
161
+ }
162
+
163
+ EID_AL_FITR_DATES_CONFIRMED_YEARS = (2022, 2025)
164
+ EID_AL_FITR_DATES = {
165
+ 2022: (MAY, 3),
166
+ 2023: (APR, 22),
167
+ 2024: (APR, 11),
168
+ 2025: (MAR, 31),
169
+ }
@@ -22,7 +22,9 @@ from holidays.groups.hebrew import HebrewCalendarHolidays
22
22
  from holidays.groups.hindu import HinduCalendarHolidays
23
23
  from holidays.groups.international import InternationalHolidays
24
24
  from holidays.groups.islamic import IslamicHolidays
25
+ from holidays.groups.mandaean import MandaeanHolidays
25
26
  from holidays.groups.mongolian import MongolianCalendarHolidays
26
27
  from holidays.groups.persian import PersianCalendarHolidays
27
28
  from holidays.groups.sinhala import SinhalaCalendarHolidays
28
29
  from holidays.groups.thai import ThaiCalendarHolidays
30
+ from holidays.groups.tibetan import TibetanCalendarHolidays
@@ -14,8 +14,9 @@ from datetime import date
14
14
 
15
15
  from dateutil.easter import EASTER_ORTHODOX, EASTER_WESTERN, easter
16
16
 
17
- from holidays.calendars.gregorian import GREGORIAN_CALENDAR, JAN, DEC, _timedelta
18
- from holidays.calendars.julian import JULIAN_CALENDAR
17
+ from holidays.calendars.ethiopian import ETHIOPIAN_CALENDAR, is_ethiopian_leap_year
18
+ from holidays.calendars.gregorian import GREGORIAN_CALENDAR, JAN, AUG, SEP, DEC, _timedelta
19
+ from holidays.calendars.julian import JULIAN_CALENDAR, julian_calendar_drift
19
20
  from holidays.calendars.julian_revised import JULIAN_REVISED_CALENDAR
20
21
 
21
22
 
@@ -36,8 +37,8 @@ class ChristianHolidays:
36
37
  self.__verify_calendar(calendar)
37
38
 
38
39
  return (
39
- date(self._year, JAN, 7)
40
- if self.__is_julian_calendar(calendar)
40
+ _timedelta(date(self._year, JAN, 7), julian_calendar_drift(self._year - 1))
41
+ if self.__is_julian_calendar(calendar) or self.__is_ethiopian_calendar(calendar)
41
42
  else date(self._year, DEC, 25)
42
43
  )
43
44
 
@@ -53,6 +54,14 @@ class ChristianHolidays:
53
54
  method=EASTER_WESTERN if self.__is_gregorian_calendar(calendar) else EASTER_ORTHODOX,
54
55
  )
55
56
 
57
+ @staticmethod
58
+ def __is_ethiopian_calendar(calendar):
59
+ """
60
+ Return True if `calendar` is Ethiopian calendar.
61
+ Return False otherwise.
62
+ """
63
+ return calendar == ETHIOPIAN_CALENDAR
64
+
56
65
  @staticmethod
57
66
  def __is_gregorian_calendar(calendar):
58
67
  """
@@ -74,10 +83,15 @@ class ChristianHolidays:
74
83
  """
75
84
  Verify calendar type.
76
85
  """
77
- if calendar not in {GREGORIAN_CALENDAR, JULIAN_CALENDAR, JULIAN_REVISED_CALENDAR}:
86
+ if calendar not in {
87
+ ETHIOPIAN_CALENDAR,
88
+ GREGORIAN_CALENDAR,
89
+ JULIAN_CALENDAR,
90
+ JULIAN_REVISED_CALENDAR,
91
+ }:
78
92
  raise ValueError(
79
- f"Unknown calendar name: {calendar}. "
80
- f"Use `{GREGORIAN_CALENDAR}`, `{JULIAN_CALENDAR}` or `{JULIAN_REVISED_CALENDAR}`."
93
+ f"Unknown calendar name: {calendar}. Use `{ETHIOPIAN_CALENDAR}`, "
94
+ f"`{GREGORIAN_CALENDAR}`, `{JULIAN_CALENDAR}` or `{JULIAN_REVISED_CALENDAR}`."
81
95
  )
82
96
 
83
97
  @property
@@ -158,7 +172,9 @@ class ChristianHolidays:
158
172
  self.__verify_calendar(calendar)
159
173
 
160
174
  return (
161
- self._add_holiday_aug_28(name)
175
+ self._add_holiday(
176
+ name, _timedelta(date(self._year, AUG, 28), julian_calendar_drift(self._year))
177
+ )
162
178
  if self.__is_julian_calendar(calendar)
163
179
  else self._add_holiday_aug_15(name)
164
180
  )
@@ -299,10 +315,30 @@ class ChristianHolidays:
299
315
  calendar = calendar or self.__calendar
300
316
  self.__verify_calendar(calendar)
301
317
 
302
- return (
303
- self._add_holiday_jan_19(name)
304
- if self.__is_julian_calendar(calendar)
305
- else self._add_holiday_jan_6(name)
318
+ if self.__is_julian_calendar(calendar) or self.__is_ethiopian_calendar(calendar):
319
+ dt = _timedelta(date(self._year, JAN, 19), julian_calendar_drift(self._year - 1))
320
+ return self._add_holiday(
321
+ name,
322
+ _timedelta(dt, +1)
323
+ if self.__is_ethiopian_calendar(calendar)
324
+ and is_ethiopian_leap_year(self._year - 1)
325
+ else dt,
326
+ )
327
+ else:
328
+ return self._add_holiday_jan_6(name)
329
+
330
+ def _add_finding_of_true_cross(self, name) -> date:
331
+ """
332
+ Add Finding of True Cross.
333
+
334
+ Finding of True Cross, also known as Meskel, is an Ethiopian and Eritrean Orthodox
335
+ Tewahedo Church holiday that commemorates the discovery of the True Cross by the
336
+ Roman Empress Saint Helena of Constantinople in the fourth century.
337
+ https://en.wikipedia.org/wiki/Meskel
338
+ """
339
+ dt = _timedelta(date(self._year, SEP, 27), julian_calendar_drift(self._year))
340
+ return self._add_holiday(
341
+ name, _timedelta(dt, +1) if is_ethiopian_leap_year(self._year) else dt
306
342
  )
307
343
 
308
344
  def _add_good_friday(self, name, calendar=None) -> date:
@@ -33,7 +33,7 @@ class EasternCalendarHolidays:
33
33
 
34
34
  Adds customizable estimation label to holiday name if holiday date is an estimation.
35
35
  """
36
- estimated_label = getattr(self, "estimated_label", "%s (estimated)")
36
+ estimated_label = getattr(self, "estimated_label", "%s")
37
37
  dt, is_estimated = dt_estimated
38
38
 
39
39
  if days_delta and dt:
@@ -12,7 +12,9 @@
12
12
 
13
13
  from datetime import date
14
14
 
15
- from holidays.calendars.gregorian import JAN
15
+ from holidays.calendars.ethiopian import is_ethiopian_leap_year
16
+ from holidays.calendars.gregorian import JAN, SEP, _timedelta
17
+ from holidays.calendars.julian import julian_calendar_drift
16
18
 
17
19
 
18
20
  class InternationalHolidays:
@@ -85,6 +87,20 @@ class InternationalHolidays:
85
87
  """
86
88
  return self._add_holiday_oct_12(name)
87
89
 
90
+ def _add_ethiopian_new_year(self, name) -> date:
91
+ """
92
+ Add Ethiopian New Year.
93
+
94
+ Ethiopian New Year, also known as Enkutatash, is a public holiday celebrated
95
+ on Meskerem 1 in the Ethiopian calendar, marking the start of the year in
96
+ Ethiopia and Eritrea.
97
+ https://en.wikipedia.org/wiki/Enkutatash
98
+ """
99
+ dt = _timedelta(date(self._year, SEP, 11), julian_calendar_drift(self._year))
100
+ return self._add_holiday(
101
+ name, _timedelta(dt, +1) if is_ethiopian_leap_year(self._year) else dt
102
+ )
103
+
88
104
  def _add_europe_day(self, name):
89
105
  """
90
106
  Add Europe Day (May 9th)
@@ -374,7 +374,7 @@ class IslamicHolidays(EasternCalendarHolidays):
374
374
  reflects the local interpretation and honor of the Prophet Muhammad.
375
375
  The term "baptism" is symbolic and not literal - there's no Islamic
376
376
  ritual akin to Christian baptism.
377
- https://www.officeholidays.com/holidays/mali/prophets-baptism
377
+ https://web.archive.org/web/20240722052111/https://www.officeholidays.com/holidays/mali/prophets-baptism
378
378
  """
379
379
  return self._add_islamic_calendar_holiday(
380
380
  name, self._islamic_calendar.mawlid_dates(self._year), days_delta=+7
@@ -0,0 +1,107 @@
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 <dr.prodigy.github@gmail.com> (c) 2017-2023
9
+ # ryanss <ryanssdev@icloud.com> (c) 2014-2017
10
+ # Website: https://github.com/vacanza/holidays
11
+ # License: MIT (see LICENSE file)
12
+
13
+ from datetime import date
14
+ from typing import Optional
15
+
16
+ from holidays.calendars.gregorian import _timedelta
17
+ from holidays.calendars.mandaean import _Mandaean
18
+
19
+
20
+ class MandaeanHolidays:
21
+ """
22
+ Mandaean holidays.
23
+ """
24
+
25
+ def __init__(self) -> None:
26
+ self._mandaean = _Mandaean()
27
+
28
+ @property
29
+ def _dehwa_hanina(self):
30
+ return self._mandaean.mandaean_to_gregorian(self._year - 1, 9, 23)
31
+
32
+ @property
33
+ def _great_feast(self):
34
+ return self._mandaean.mandaean_to_gregorian(self._year, 1, 6)
35
+
36
+ @property
37
+ def _parwanaya(self):
38
+ return self._mandaean.mandaean_to_gregorian(self._year - 1, 13, 1)
39
+
40
+ def _add_mandaean_holiday(self, name: str, dt: Optional[date]) -> Optional[date]:
41
+ """
42
+ Add a Mandaean holiday.
43
+ """
44
+ if dt is None:
45
+ return None
46
+ return self._add_holiday(name, dt)
47
+
48
+ def _add_parwanaya_day(self, name) -> Optional[date]:
49
+ """
50
+ Add Parwanaya (Feast of Creation).
51
+ A major Mandaean holiday celebrated over five days after the 8th month.
52
+ The five intercalary days are considered as the 13th month.
53
+ Marks the creation of the world and renewal of life.
54
+ https://en.wikipedia.org/wiki/Parwanaya
55
+ """
56
+ return self._add_mandaean_holiday(name, self._parwanaya)
57
+
58
+ def _add_parwanaya_day_two(self, name) -> Optional[date]:
59
+ return self._add_mandaean_holiday(name, _timedelta(self._parwanaya, +1))
60
+
61
+ def _add_parwanaya_day_three(self, name) -> Optional[date]:
62
+ return self._add_mandaean_holiday(name, _timedelta(self._parwanaya, +2))
63
+
64
+ def _add_parwanaya_day_four(self, name) -> Optional[date]:
65
+ return self._add_mandaean_holiday(name, _timedelta(self._parwanaya, +3))
66
+
67
+ def _add_parwanaya_day_five(self, name) -> Optional[date]:
68
+ return self._add_mandaean_holiday(name, _timedelta(self._parwanaya, +4))
69
+
70
+ def _add_dehwa_daimana_day(self, name) -> Optional[date]:
71
+ """
72
+ Add Dehwa Daimana (Birthday of Prophet Yahya).
73
+ Celebrated on 1st day of Mandaean 11th month.
74
+ https://en.wikipedia.org/wiki/Dehwa_Daimana
75
+ """
76
+ return self._add_mandaean_holiday(
77
+ name, self._mandaean.mandaean_to_gregorian(self._year - 1, 11, 1)
78
+ )
79
+
80
+ def _add_dehwa_hanina_day(self, name) -> Optional[date]:
81
+ """
82
+ Add Dehwa Hanina (Little Feast / Day of Victory).
83
+ Commemorates spiritual triumph and deliverance.
84
+ Celebrated on 23rd day of the 9th Mandaean month.
85
+ https://en.wikipedia.org/wiki/Dehwa_Hanina
86
+ """
87
+ return self._add_mandaean_holiday(name, self._dehwa_hanina)
88
+
89
+ def _add_dehwa_hanina_day_two(self, name) -> Optional[date]:
90
+ return self._add_mandaean_holiday(name, _timedelta(self._dehwa_hanina, +1))
91
+
92
+ def _add_great_feast_day(self, name) -> Optional[date]:
93
+ """
94
+ Add Great Feast (Feast of the Great Shishlam).
95
+ Celebrated on the 6th day of the first month of the Mandaean calendar.
96
+ https://en.wikipedia.org/wiki/Feast_of_the_Great_Shishlam
97
+ """
98
+ return self._add_mandaean_holiday(name, self._great_feast)
99
+
100
+ def _add_great_feast_day_two(self, name) -> Optional[date]:
101
+ return self._add_mandaean_holiday(name, _timedelta(self._great_feast, +1))
102
+
103
+ def _add_great_feast_day_three(self, name) -> Optional[date]:
104
+ return self._add_mandaean_holiday(name, _timedelta(self._great_feast, +2))
105
+
106
+ def _add_great_feast_day_four(self, name) -> Optional[date]:
107
+ return self._add_mandaean_holiday(name, _timedelta(self._great_feast, +3))
@@ -0,0 +1,153 @@
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 <dr.prodigy.github@gmail.com> (c) 2017-2023
9
+ # ryanss <ryanssdev@icloud.com> (c) 2014-2017
10
+ # Website: https://github.com/vacanza/holidays
11
+ # License: MIT (see LICENSE file)
12
+
13
+ from datetime import date
14
+ from typing import Optional
15
+
16
+ from holidays.calendars import _TibetanLunisolar
17
+ from holidays.groups.eastern import EasternCalendarHolidays
18
+
19
+
20
+ class TibetanCalendarHolidays(EasternCalendarHolidays):
21
+ """
22
+ Tibetan lunisolar calendar holidays.
23
+ """
24
+
25
+ def __init__(self, cls=None, show_estimated=False) -> None:
26
+ self._tibetan_calendar = cls() if cls else _TibetanLunisolar()
27
+ self._tibetan_calendar_show_estimated = show_estimated
28
+
29
+ def _add_tibetan_calendar_holiday(
30
+ self, name: str, dt_estimated: tuple[Optional[date], bool], days_delta: int = 0
31
+ ) -> Optional[date]:
32
+ """
33
+ Add Tibetan calendar holiday.
34
+
35
+ Adds customizable estimation label to holiday name if holiday date
36
+ is an estimation.
37
+ """
38
+ return self._add_eastern_calendar_holiday(
39
+ name, dt_estimated, self._tibetan_calendar_show_estimated, days_delta
40
+ )
41
+
42
+ def _add_blessed_rainy_day(self, name) -> Optional[date]:
43
+ """
44
+ Add Blessed Rainy Day (September Equinox of Autumn Calendar).
45
+ """
46
+ return self._add_tibetan_calendar_holiday(
47
+ name, self._tibetan_calendar.blessed_rainy_day_date(self._year)
48
+ )
49
+
50
+ def _add_birth_of_guru_rinpoche(self, name) -> Optional[date]:
51
+ """
52
+ Add Birth of Guru Rinpoche (10th day of the 5th lunar month).
53
+ """
54
+ return self._add_tibetan_calendar_holiday(
55
+ name, self._tibetan_calendar.birth_of_guru_rinpoche_date(self._year)
56
+ )
57
+
58
+ def _add_buddha_first_sermon(self, name) -> Optional[date]:
59
+ """
60
+ Add Buddha First Sermon (4th day of the 6th lunar month).
61
+ """
62
+ return self._add_tibetan_calendar_holiday(
63
+ name, self._tibetan_calendar.buddha_first_sermon_date(self._year)
64
+ )
65
+
66
+ def _add_buddha_parinirvana(self, name) -> Optional[date]:
67
+ """
68
+ Add Buddha Parinirvana (15th day of the 4th lunar month).
69
+ """
70
+ return self._add_tibetan_calendar_holiday(
71
+ name, self._tibetan_calendar.buddha_parinirvana_date(self._year)
72
+ )
73
+
74
+ def _add_day_of_offering(self, name) -> Optional[date]:
75
+ """
76
+ Add Day of Offering (1st day of the 12th lunar month).
77
+ """
78
+ return self._add_tibetan_calendar_holiday(
79
+ name, self._tibetan_calendar.day_of_offering_date(self._year)
80
+ )
81
+
82
+ def _add_death_of_zhabdrung(self, name) -> Optional[date]:
83
+ """
84
+ Add Death of Zhabdrung (10th day of the 3rd lunar month).
85
+ """
86
+ return self._add_tibetan_calendar_holiday(
87
+ name, self._tibetan_calendar.death_of_zhabdrung_date(self._year)
88
+ )
89
+
90
+ def _add_descending_day_of_lord_buddha(self, name) -> Optional[date]:
91
+ """
92
+ Add Descending Day of Lord Buddha (22nd day of the 9th lunar month).
93
+ """
94
+ return self._add_tibetan_calendar_holiday(
95
+ name, self._tibetan_calendar.descending_day_of_lord_buddha_date(self._year)
96
+ )
97
+
98
+ def _add_losar(self, name) -> Optional[date]:
99
+ """
100
+ Add Losar (1st day of the 1st lunar month).
101
+ """
102
+ return self._add_tibetan_calendar_holiday(
103
+ name, self._tibetan_calendar.losar_date(self._year)
104
+ )
105
+
106
+ def _add_losar_day_two(self, name) -> set[date]:
107
+ """
108
+ Add Losar Day Two.
109
+ """
110
+ dt = self._add_tibetan_calendar_holiday(
111
+ name, self._tibetan_calendar.losar_date(self._year), days_delta=+1
112
+ )
113
+ return {dt} if dt is not None else set()
114
+
115
+ def _add_thimphu_drubchen_day(self, name) -> Optional[date]:
116
+ """
117
+ Add Thimphu Drubchen (6th day of the 8th lunar month).
118
+ """
119
+ return self._add_tibetan_calendar_holiday(
120
+ name, self._tibetan_calendar.thimphu_drubchen_date(self._year), days_delta=+1
121
+ )
122
+
123
+ def _add_thimphu_tshechu_day(self, name) -> Optional[date]:
124
+ """
125
+ Add Thimphu Tshechu (10th day of the 8th lunar month).
126
+ """
127
+ return self._add_tibetan_calendar_holiday(
128
+ name, self._tibetan_calendar.thimphu_tshechu_date(self._year)
129
+ )
130
+
131
+ def _add_thimphu_tshechu_day_two(self, name) -> Optional[date]:
132
+ """
133
+ Add Thimphu Tshechu Day 2.
134
+ """
135
+ return self._add_tibetan_calendar_holiday(
136
+ name, self._tibetan_calendar.thimphu_tshechu_date(self._year), days_delta=+1
137
+ )
138
+
139
+ def _add_thimphu_tshechu_day_three(self, name) -> Optional[date]:
140
+ """
141
+ Add Thimphu Tshechu Day 3.
142
+ """
143
+ return self._add_tibetan_calendar_holiday(
144
+ name, self._tibetan_calendar.thimphu_tshechu_date(self._year), days_delta=+2
145
+ )
146
+
147
+ def _add_tibetan_winter_solstice(self, name) -> Optional[date]:
148
+ """
149
+ Add Winter Solstice Day.
150
+ """
151
+ return self._add_tibetan_calendar_holiday(
152
+ name, self._tibetan_calendar.tibetan_winter_solstice_date(self._year)
153
+ )