holidays 0.79__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.
- holidays/calendars/hindu.py +1 -0
- holidays/constants.py +0 -1
- holidays/countries/__init__.py +7 -0
- holidays/countries/argentina.py +4 -0
- holidays/countries/australia.py +191 -295
- holidays/countries/bosnia_and_herzegovina.py +5 -1
- holidays/countries/burkina_faso.py +5 -0
- holidays/countries/burundi.py +95 -40
- holidays/countries/cameroon.py +5 -0
- holidays/countries/canada.py +7 -0
- holidays/countries/chad.py +5 -0
- holidays/countries/christmas_island.py +6 -0
- holidays/countries/comoros.py +121 -0
- holidays/countries/eritrea.py +104 -0
- holidays/countries/gabon.py +2 -0
- holidays/countries/georgia.py +9 -7
- holidays/countries/guinea_bissau.py +0 -4
- holidays/countries/kyrgyzstan.py +2 -0
- holidays/countries/macau.py +65 -63
- holidays/countries/maldives.py +2 -0
- holidays/countries/mauritania.py +2 -0
- holidays/countries/nigeria.py +198 -27
- holidays/countries/rwanda.py +162 -0
- holidays/countries/sierra_leone.py +1 -1
- holidays/countries/singapore.py +4 -0
- holidays/countries/somalia.py +79 -0
- holidays/countries/south_sudan.py +133 -0
- holidays/countries/spain.py +4 -0
- holidays/countries/tajikistan.py +116 -0
- holidays/countries/tanzania.py +291 -147
- holidays/countries/turkmenistan.py +6 -0
- holidays/countries/uganda.py +101 -0
- holidays/financial/__init__.py +5 -0
- holidays/financial/national_stock_exchange_of_india.py +169 -0
- holidays/groups/eastern.py +1 -1
- holidays/locale/bs/LC_MESSAGES/BA.mo +0 -0
- holidays/locale/en_IN/LC_MESSAGES/XNSE.mo +0 -0
- holidays/locale/en_MO/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/en_NG/LC_MESSAGES/NG.mo +0 -0
- holidays/locale/en_SG/LC_MESSAGES/SG.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BA.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BI.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GE.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/NG.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/RW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/SG.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/TJ.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/TZ.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/XNSE.mo +0 -0
- holidays/locale/es/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/es/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/fr/LC_MESSAGES/RW.mo +0 -0
- holidays/locale/fr_BI/LC_MESSAGES/BI.mo +0 -0
- holidays/locale/hi/LC_MESSAGES/XNSE.mo +0 -0
- holidays/locale/ka/LC_MESSAGES/GE.mo +0 -0
- holidays/locale/pt_GW/LC_MESSAGES/GW.mo +0 -0
- holidays/locale/pt_MO/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/ru/LC_MESSAGES/TJ.mo +0 -0
- holidays/locale/rw/LC_MESSAGES/RW.mo +0 -0
- holidays/locale/sr/LC_MESSAGES/BA.mo +0 -0
- holidays/locale/sw/LC_MESSAGES/TZ.mo +0 -0
- holidays/locale/tg/LC_MESSAGES/TJ.mo +0 -0
- holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/th/LC_MESSAGES/SG.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/BA.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/ES.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/GE.mo +0 -0
- holidays/locale/zh_CN/LC_MESSAGES/MO.mo +0 -0
- holidays/locale/zh_MO/LC_MESSAGES/MO.mo +0 -0
- holidays/registry.py +33 -14
- holidays/version.py +1 -1
- {holidays-0.79.dist-info → holidays-0.80.dist-info}/METADATA +62 -7
- {holidays-0.79.dist-info → holidays-0.80.dist-info}/RECORD +82 -61
- {holidays-0.79.dist-info → holidays-0.80.dist-info}/WHEEL +0 -0
- {holidays-0.79.dist-info → holidays-0.80.dist-info}/licenses/CONTRIBUTORS +0 -0
- {holidays-0.79.dist-info → holidays-0.80.dist-info}/licenses/LICENSE +0 -0
- {holidays-0.79.dist-info → holidays-0.80.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
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 holidays.groups import ChristianHolidays, InternationalHolidays, IslamicHolidays
|
|
14
|
+
from holidays.holiday_base import HolidayBase
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Uganda(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays):
|
|
18
|
+
"""Uganda holidays.
|
|
19
|
+
|
|
20
|
+
References:
|
|
21
|
+
* <https://en.wikipedia.org/wiki/Public_holidays_in_Uganda>
|
|
22
|
+
* [Public Holidays Act, Cap. 255](https://web.archive.org/web/20250621140041/https://ulii.org/akn/ug/act/1965/23/eng@2000-12-31)
|
|
23
|
+
* [National Events and Calendar](https://web.archive.org/web/20250618053410/https://www.vicepresident.go.ug/national-events-and-calender/)
|
|
24
|
+
* [National Heroes Day](https://web.archive.org/web/20230622162351/https://publicholidays.africa/uganda/national-heroes-day/)
|
|
25
|
+
* [NRM Liberation Day](https://web.archive.org/web/20240124064853/https://thenilewires.com/38th-nrm-a-liberation-day-celebrations-minister-outlines-nrm-achievements/)
|
|
26
|
+
* [Archbishop Janani Luwum Day](https://web.archive.org/web/20200805133919/https://www.newvision.co.ug/news/1417242/uganda-declared-february-archbishop-janani-luwum-public-holiday)
|
|
27
|
+
* [School Calendar 2024](https://web.archive.org/web/20240519021615/https://www.education.go.ug/wp-content/uploads/2023/11/SCHOOL-CALENDAR.pdf)
|
|
28
|
+
* [Public Holidays 2025](https://web.archive.org/web/20250710193157/https://publicholidays.co.ug/)
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
country = "UG"
|
|
32
|
+
# %s (estimated).
|
|
33
|
+
estimated_label = "%s (estimated)"
|
|
34
|
+
# Uganda gained independence from the United Kingdom on October 9, 1962.
|
|
35
|
+
start_year = 1963
|
|
36
|
+
|
|
37
|
+
def __init__(self, *args, islamic_show_estimated: bool = True, **kwargs):
|
|
38
|
+
"""
|
|
39
|
+
Args:
|
|
40
|
+
islamic_show_estimated:
|
|
41
|
+
Whether to add "estimated" label to Islamic holidays name
|
|
42
|
+
if holiday date is estimated.
|
|
43
|
+
"""
|
|
44
|
+
ChristianHolidays.__init__(self)
|
|
45
|
+
InternationalHolidays.__init__(self)
|
|
46
|
+
IslamicHolidays.__init__(self, show_estimated=islamic_show_estimated)
|
|
47
|
+
super().__init__(*args, **kwargs)
|
|
48
|
+
|
|
49
|
+
def _populate_public_holidays(self):
|
|
50
|
+
# New Year's Day.
|
|
51
|
+
self._add_new_years_day("New Year's Day")
|
|
52
|
+
|
|
53
|
+
if self._year >= 1987:
|
|
54
|
+
# NRM Liberation Day.
|
|
55
|
+
self._add_holiday_jan_26("NRM Liberation Day")
|
|
56
|
+
|
|
57
|
+
if self._year >= 2016:
|
|
58
|
+
# Archbishop Janani Luwum Day.
|
|
59
|
+
self._add_holiday_feb_16("Archbishop Janani Luwum Day")
|
|
60
|
+
|
|
61
|
+
# Women's Day.
|
|
62
|
+
self._add_womens_day("Women's Day")
|
|
63
|
+
|
|
64
|
+
# Good Friday.
|
|
65
|
+
self._add_good_friday("Good Friday")
|
|
66
|
+
|
|
67
|
+
# Easter Monday.
|
|
68
|
+
self._add_easter_monday("Easter Monday")
|
|
69
|
+
|
|
70
|
+
# Labor Day.
|
|
71
|
+
self._add_labor_day("Labour Day")
|
|
72
|
+
|
|
73
|
+
# Uganda Martyrs' Day.
|
|
74
|
+
self._add_holiday_jun_3("Uganda Martyrs' Day")
|
|
75
|
+
|
|
76
|
+
if self._year >= 2001:
|
|
77
|
+
# National Heroes' Day.
|
|
78
|
+
self._add_holiday_jun_9("National Heroes' Day")
|
|
79
|
+
|
|
80
|
+
# Independence Day.
|
|
81
|
+
self._add_holiday_oct_9("Independence Day")
|
|
82
|
+
|
|
83
|
+
# Christmas Day.
|
|
84
|
+
self._add_christmas_day("Christmas Day")
|
|
85
|
+
|
|
86
|
+
# Boxing Day.
|
|
87
|
+
self._add_christmas_day_two("Boxing Day")
|
|
88
|
+
|
|
89
|
+
# Eid al-Fitr.
|
|
90
|
+
self._add_eid_al_fitr_day("Eid al-Fitr")
|
|
91
|
+
|
|
92
|
+
# Eid al-Adha.
|
|
93
|
+
self._add_eid_al_adha_day("Eid al-Adha")
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
class UG(Uganda):
|
|
97
|
+
pass
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class UGA(Uganda):
|
|
101
|
+
pass
|
holidays/financial/__init__.py
CHANGED
|
@@ -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
|
+
}
|
holidays/groups/eastern.py
CHANGED
|
@@ -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
|
|
36
|
+
estimated_label = getattr(self, "estimated_label", "%s")
|
|
37
37
|
dt, is_estimated = dt_estimated
|
|
38
38
|
|
|
39
39
|
if days_delta and dt:
|
|
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
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import importlib
|
|
14
14
|
from collections.abc import Iterable
|
|
15
15
|
from threading import RLock
|
|
16
|
-
from typing import Any, Optional
|
|
16
|
+
from typing import Any, Optional
|
|
17
17
|
|
|
18
18
|
from holidays.holiday_base import HolidayBase
|
|
19
19
|
|
|
@@ -67,6 +67,7 @@ COUNTRIES: RegistryDict = {
|
|
|
67
67
|
"christmas_island": ("ChristmasIsland", "CX", "CXR"),
|
|
68
68
|
"cocos_islands": ("CocosIslands", "CC", "CCK"),
|
|
69
69
|
"colombia": ("Colombia", "CO", "COL"),
|
|
70
|
+
"comoros": ("Comoros", "KM", "COM"),
|
|
70
71
|
"congo": ("Congo", "CG", "COG"),
|
|
71
72
|
"cook_islands": ("CookIslands", "CK", "COK"),
|
|
72
73
|
"costa_rica": ("CostaRica", "CR", "CRI"),
|
|
@@ -85,6 +86,7 @@ COUNTRIES: RegistryDict = {
|
|
|
85
86
|
"jordan": ("Jordan", "JO", "JOR"),
|
|
86
87
|
"el_salvador": ("ElSalvador", "SV", "SLV"),
|
|
87
88
|
"equatorial_guinea": ("EquatorialGuinea", "GQ", "GNQ"),
|
|
89
|
+
"eritrea": ("Eritrea", "ER", "ERI"),
|
|
88
90
|
"estonia": ("Estonia", "EE", "EST"),
|
|
89
91
|
"eswatini": ("Eswatini", "SZ", "SZW", "Swaziland"),
|
|
90
92
|
"ethiopia": ("Ethiopia", "ET", "ETH"),
|
|
@@ -195,6 +197,7 @@ COUNTRIES: RegistryDict = {
|
|
|
195
197
|
"reunion": ("Reunion", "RE", "REU", "HolidaysRE"),
|
|
196
198
|
"romania": ("Romania", "RO", "ROU"),
|
|
197
199
|
"russia": ("Russia", "RU", "RUS"),
|
|
200
|
+
"rwanda": ("Rwanda", "RW", "RWA"),
|
|
198
201
|
"saint_barthelemy": ("SaintBarthelemy", "BL", "BLM", "HolidaysBL"),
|
|
199
202
|
"saint_kitts_and_nevis": ("SaintKittsAndNevis", "KN", "KNA"),
|
|
200
203
|
"saint_lucia": ("SaintLucia", "LC", "LCA"),
|
|
@@ -214,6 +217,7 @@ COUNTRIES: RegistryDict = {
|
|
|
214
217
|
"slovakia": ("Slovakia", "SK", "SVK"),
|
|
215
218
|
"slovenia": ("Slovenia", "SI", "SVN"),
|
|
216
219
|
"solomon_islands": ("SolomonIslands", "SB", "SLB"),
|
|
220
|
+
"somalia": ("Somalia", "SO", "SOM"),
|
|
217
221
|
"south_africa": ("SouthAfrica", "ZA", "ZAF"),
|
|
218
222
|
"south_georgia_and_the_south_sandwich_islands": (
|
|
219
223
|
"SouthGeorgiaAndTheSouthSandwichIslands",
|
|
@@ -221,6 +225,7 @@ COUNTRIES: RegistryDict = {
|
|
|
221
225
|
"SGS",
|
|
222
226
|
),
|
|
223
227
|
"south_korea": ("SouthKorea", "KR", "KOR", "Korea"),
|
|
228
|
+
"south_sudan": ("SouthSudan", "SS", "SSD"),
|
|
224
229
|
"spain": ("Spain", "ES", "ESP"),
|
|
225
230
|
"sri_lanka": ("SriLanka", "LK", "LKA"),
|
|
226
231
|
"suriname": ("Suriname", "SR", "SUR"),
|
|
@@ -229,6 +234,7 @@ COUNTRIES: RegistryDict = {
|
|
|
229
234
|
"switzerland": ("Switzerland", "CH", "CHE"),
|
|
230
235
|
"syrian_arab_republic": ("SyrianArabRepublic", "SY", "SYR"),
|
|
231
236
|
"taiwan": ("Taiwan", "TW", "TWN"),
|
|
237
|
+
"tajikistan": ("Tajikistan", "TJ", "TJK"),
|
|
232
238
|
"tanzania": ("Tanzania", "TZ", "TZA"),
|
|
233
239
|
"thailand": ("Thailand", "TH", "THA"),
|
|
234
240
|
"timor_leste": ("TimorLeste", "TL", "TLS"),
|
|
@@ -241,6 +247,7 @@ COUNTRIES: RegistryDict = {
|
|
|
241
247
|
"turkmenistan": ("Turkmenistan", "TM", "TKM"),
|
|
242
248
|
"turks_and_caicos_islands": ("TurksAndCaicosIslands", "TC", "TCA"),
|
|
243
249
|
"tuvalu": ("Tuvalu", "TV", "TUV"),
|
|
250
|
+
"uganda": ("Uganda", "UG", "UGA"),
|
|
244
251
|
"ukraine": ("Ukraine", "UA", "UKR"),
|
|
245
252
|
"united_arab_emirates": ("UnitedArabEmirates", "AE", "ARE"),
|
|
246
253
|
"united_kingdom": ("UnitedKingdom", "GB", "GBR", "UK"),
|
|
@@ -265,10 +272,11 @@ COUNTRIES: RegistryDict = {
|
|
|
265
272
|
}
|
|
266
273
|
|
|
267
274
|
FINANCIAL: RegistryDict = {
|
|
275
|
+
"brasil_bolsa_balcao": ("BrasilBolsaBalcao", "BVMF", "B3"),
|
|
268
276
|
"european_central_bank": ("EuropeanCentralBank", "XECB", "ECB", "TAR"),
|
|
269
277
|
"ice_futures_europe": ("ICEFuturesEurope", "IFEU"),
|
|
278
|
+
"national_stock_exchange_of_india": ("NationalStockExchangeOfIndia", "XNSE", "NSE"),
|
|
270
279
|
"ny_stock_exchange": ("NewYorkStockExchange", "XNYS", "NYSE"),
|
|
271
|
-
"brasil_bolsa_balcao": ("BrasilBolsaBalcao", "BVMF", "B3"),
|
|
272
280
|
}
|
|
273
281
|
|
|
274
282
|
# A re-entrant lock. Once a thread has acquired a re-entrant lock,
|
|
@@ -331,35 +339,46 @@ class EntityLoader:
|
|
|
331
339
|
@staticmethod
|
|
332
340
|
def _get_entity_codes(
|
|
333
341
|
container: RegistryDict,
|
|
334
|
-
entity_length: Union[int, Iterable[int]],
|
|
335
342
|
include_aliases: bool = True,
|
|
343
|
+
max_code_length: int = 3,
|
|
344
|
+
min_code_length: int = 2,
|
|
336
345
|
) -> Iterable[str]:
|
|
337
|
-
entity_length = {entity_length} if isinstance(entity_length, int) else set(entity_length)
|
|
338
346
|
for entities in container.values():
|
|
339
|
-
for
|
|
340
|
-
if len(
|
|
341
|
-
yield
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
347
|
+
for code in entities[1:]:
|
|
348
|
+
if min_code_length <= len(code) <= max_code_length:
|
|
349
|
+
yield code
|
|
350
|
+
|
|
351
|
+
# Stop after the first matching code if aliases are not requested.
|
|
352
|
+
# Assuming that the alpha-2 code goes first.
|
|
353
|
+
if not include_aliases:
|
|
354
|
+
break
|
|
345
355
|
|
|
346
356
|
@staticmethod
|
|
347
357
|
def get_country_codes(include_aliases: bool = True) -> Iterable[str]:
|
|
348
358
|
"""Get supported country codes.
|
|
349
359
|
|
|
350
360
|
:param include_aliases:
|
|
351
|
-
Whether to include entity aliases (e.g. UK for GB
|
|
361
|
+
Whether to include entity aliases (e.g. GBR and UK for GB,
|
|
362
|
+
UKR for UA, USA for US, etc).
|
|
352
363
|
"""
|
|
353
|
-
return EntityLoader._get_entity_codes(
|
|
364
|
+
return EntityLoader._get_entity_codes(
|
|
365
|
+
COUNTRIES,
|
|
366
|
+
include_aliases=include_aliases,
|
|
367
|
+
)
|
|
354
368
|
|
|
355
369
|
@staticmethod
|
|
356
370
|
def get_financial_codes(include_aliases: bool = True) -> Iterable[str]:
|
|
357
371
|
"""Get supported financial codes.
|
|
358
372
|
|
|
359
373
|
:param include_aliases:
|
|
360
|
-
Whether to include entity aliases(e.g.
|
|
374
|
+
Whether to include entity aliases (e.g. B3 for BVMF,
|
|
375
|
+
TAR for ECB, NYSE for XNYS, etc).
|
|
361
376
|
"""
|
|
362
|
-
return EntityLoader._get_entity_codes(
|
|
377
|
+
return EntityLoader._get_entity_codes(
|
|
378
|
+
FINANCIAL,
|
|
379
|
+
include_aliases=include_aliases,
|
|
380
|
+
max_code_length=4,
|
|
381
|
+
)
|
|
363
382
|
|
|
364
383
|
@staticmethod
|
|
365
384
|
def load(prefix: str, scope: dict) -> None:
|
holidays/version.py
CHANGED