holidays 0.25__py3-none-any.whl → 0.27__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/__init__.py +1 -1
- holidays/calendars/__init__.py +9 -7
- holidays/calendars/buddhist.py +445 -0
- holidays/calendars/chinese.py +1238 -431
- holidays/calendars/custom.py +1 -3
- holidays/calendars/hebrew.py +2 -2
- holidays/calendars/hindu.py +445 -0
- holidays/calendars/islamic.py +1347 -1347
- holidays/calendars/thai.py +229 -38
- holidays/countries/__init__.py +8 -0
- holidays/countries/albania.py +6 -17
- holidays/countries/andorra.py +2 -6
- holidays/countries/angola.py +53 -39
- holidays/countries/argentina.py +25 -35
- holidays/countries/armenia.py +1 -0
- holidays/countries/aruba.py +109 -48
- holidays/countries/australia.py +31 -69
- holidays/countries/austria.py +1 -0
- holidays/countries/azerbaijan.py +44 -71
- holidays/countries/bahrain.py +7 -7
- holidays/countries/bangladesh.py +1 -3
- holidays/countries/belarus.py +2 -3
- holidays/countries/belize.py +128 -0
- holidays/countries/bolivia.py +2 -6
- holidays/countries/bosnia_and_herzegovina.py +5 -17
- holidays/countries/botswana.py +37 -44
- holidays/countries/brazil.py +4 -7
- holidays/countries/brunei.py +427 -0
- holidays/countries/bulgaria.py +3 -6
- holidays/countries/burkina_faso.py +141 -0
- holidays/countries/burundi.py +2 -5
- holidays/countries/cambodia.py +323 -0
- holidays/countries/cameroon.py +183 -0
- holidays/countries/canada.py +20 -28
- holidays/countries/chad.py +133 -0
- holidays/countries/chile.py +6 -13
- holidays/countries/china.py +21 -25
- holidays/countries/colombia.py +18 -15
- holidays/countries/costa_rica.py +25 -27
- holidays/countries/cuba.py +28 -15
- holidays/countries/curacao.py +100 -46
- holidays/countries/cyprus.py +3 -6
- holidays/countries/czechia.py +4 -12
- holidays/countries/denmark.py +2 -3
- holidays/countries/dominican_republic.py +2 -3
- holidays/countries/ecuador.py +55 -54
- holidays/countries/egypt.py +2 -5
- holidays/countries/el_salvador.py +101 -0
- holidays/countries/eswatini.py +34 -44
- holidays/countries/ethiopia.py +7 -14
- holidays/countries/finland.py +2 -3
- holidays/countries/france.py +1 -0
- holidays/countries/gabon.py +139 -0
- holidays/countries/georgia.py +1 -0
- holidays/countries/germany.py +1 -0
- holidays/countries/greece.py +7 -6
- holidays/countries/honduras.py +17 -13
- holidays/countries/hongkong.py +117 -126
- holidays/countries/hungary.py +93 -92
- holidays/countries/iceland.py +1 -0
- holidays/countries/india.py +4 -11
- holidays/countries/indonesia.py +178 -142
- holidays/countries/ireland.py +5 -15
- holidays/countries/isle_of_man.py +23 -5
- holidays/countries/israel.py +12 -24
- holidays/countries/italy.py +6 -7
- holidays/countries/jamaica.py +10 -18
- holidays/countries/japan.py +11 -16
- holidays/countries/kazakhstan.py +7 -22
- holidays/countries/kenya.py +44 -26
- holidays/countries/kyrgyzstan.py +2 -5
- holidays/countries/latvia.py +2 -6
- holidays/countries/lesotho.py +52 -32
- holidays/countries/liechtenstein.py +1 -0
- holidays/countries/lithuania.py +4 -12
- holidays/countries/madagascar.py +3 -9
- holidays/countries/malawi.py +34 -26
- holidays/countries/malaysia.py +335 -343
- holidays/countries/marshall_islands.py +4 -9
- holidays/countries/mexico.py +2 -3
- holidays/countries/moldova.py +4 -6
- holidays/countries/monaco.py +17 -26
- holidays/countries/montenegro.py +34 -24
- holidays/countries/morocco.py +8 -5
- holidays/countries/mozambique.py +35 -31
- holidays/countries/namibia.py +54 -35
- holidays/countries/netherlands.py +1 -0
- holidays/countries/new_zealand.py +166 -134
- holidays/countries/nicaragua.py +27 -22
- holidays/countries/nigeria.py +6 -17
- holidays/countries/north_macedonia.py +3 -8
- holidays/countries/norway.py +2 -3
- holidays/countries/pakistan.py +73 -75
- holidays/countries/panama.py +25 -24
- holidays/countries/paraguay.py +55 -47
- holidays/countries/peru.py +1 -0
- holidays/countries/philippines.py +6 -2
- holidays/countries/poland.py +4 -9
- holidays/countries/portugal.py +4 -11
- holidays/countries/romania.py +4 -5
- holidays/countries/russia.py +1 -0
- holidays/countries/san_marino.py +26 -27
- holidays/countries/saudi_arabia.py +8 -22
- holidays/countries/serbia.py +22 -31
- holidays/countries/singapore.py +181 -189
- holidays/countries/slovakia.py +2 -4
- holidays/countries/south_africa.py +60 -62
- holidays/countries/south_korea.py +59 -26
- holidays/countries/spain.py +7 -10
- holidays/countries/sweden.py +2 -3
- holidays/countries/switzerland.py +1 -0
- holidays/countries/taiwan.py +20 -20
- holidays/countries/thailand.py +36 -82
- holidays/countries/turkey.py +1 -3
- holidays/countries/ukraine.py +7 -18
- holidays/countries/united_arab_emirates.py +23 -31
- holidays/countries/united_kingdom.py +124 -116
- holidays/countries/united_states.py +42 -72
- holidays/countries/uruguay.py +1 -0
- holidays/countries/vatican_city.py +64 -32
- holidays/countries/venezuela.py +9 -6
- holidays/countries/vietnam.py +6 -20
- holidays/countries/zambia.py +63 -33
- holidays/countries/zimbabwe.py +56 -37
- holidays/financial/european_central_bank.py +15 -16
- holidays/financial/ny_stock_exchange.py +80 -86
- holidays/groups/__init__.py +18 -0
- holidays/groups/buddhist.py +71 -0
- holidays/groups/chinese.py +235 -0
- holidays/groups/christian.py +483 -0
- holidays/groups/hindu.py +71 -0
- holidays/groups/international.py +157 -0
- holidays/groups/islamic.py +288 -0
- holidays/groups/thai.py +157 -0
- holidays/helpers.py +20 -0
- holidays/holiday_base.py +54 -76
- holidays/holiday_groups.py +11 -1053
- holidays/locale/am/LC_MESSAGES/ET.mo +0 -0
- holidays/locale/am/LC_MESSAGES/ET.po +20 -15
- holidays/locale/ar/LC_MESSAGES/CA.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/CA.po +184 -0
- holidays/locale/ar/LC_MESSAGES/ET.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/ET.po +92 -0
- holidays/locale/ar/LC_MESSAGES/UA.mo +0 -0
- holidays/locale/ar/LC_MESSAGES/UA.po +97 -0
- holidays/locale/be/LC_MESSAGES/BY.po +11 -13
- holidays/locale/bg/LC_MESSAGES/BG.po +13 -15
- holidays/locale/da/LC_MESSAGES/DK.po +13 -12
- holidays/locale/de/LC_MESSAGES/AT.po +14 -14
- holidays/locale/de/LC_MESSAGES/CH.po +91 -56
- holidays/locale/de/LC_MESSAGES/DE.po +32 -32
- holidays/locale/de/LC_MESSAGES/LI.po +23 -23
- holidays/locale/el/LC_MESSAGES/CY.po +16 -16
- holidays/locale/el/LC_MESSAGES/GR.mo +0 -0
- holidays/locale/el/LC_MESSAGES/GR.po +21 -17
- holidays/locale/en/LC_MESSAGES/CA.po +43 -43
- holidays/locale/en_US/LC_MESSAGES/AM.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AM.po +20 -20
- holidays/locale/en_US/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AR.po +34 -33
- holidays/locale/en_US/LC_MESSAGES/AT.po +13 -13
- holidays/locale/en_US/LC_MESSAGES/AW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/AW.po +87 -0
- holidays/locale/en_US/LC_MESSAGES/BG.po +13 -15
- holidays/locale/en_US/LC_MESSAGES/BN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/BN.po +96 -0
- holidays/locale/en_US/LC_MESSAGES/BY.po +11 -13
- holidays/locale/en_US/LC_MESSAGES/CA.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CA.po +70 -37
- holidays/locale/en_US/LC_MESSAGES/CH.po +91 -56
- holidays/locale/en_US/LC_MESSAGES/CL.po +39 -38
- holidays/locale/en_US/LC_MESSAGES/CO.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CO.po +27 -27
- holidays/locale/en_US/LC_MESSAGES/CR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CR.po +19 -19
- holidays/locale/en_US/LC_MESSAGES/CU.po +10 -10
- holidays/locale/en_US/LC_MESSAGES/CW.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/CW.po +82 -0
- holidays/locale/en_US/LC_MESSAGES/CY.po +16 -16
- holidays/locale/en_US/LC_MESSAGES/DE.po +30 -30
- holidays/locale/en_US/LC_MESSAGES/DK.po +12 -11
- holidays/locale/en_US/LC_MESSAGES/DO.po +12 -12
- holidays/locale/en_US/LC_MESSAGES/EC.po +11 -12
- holidays/locale/en_US/LC_MESSAGES/ET.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/ET.po +20 -15
- holidays/locale/en_US/LC_MESSAGES/FI.po +15 -15
- holidays/locale/en_US/LC_MESSAGES/FR.po +27 -24
- holidays/locale/en_US/LC_MESSAGES/GE.po +23 -27
- holidays/locale/en_US/LC_MESSAGES/GR.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/GR.po +21 -17
- holidays/locale/en_US/LC_MESSAGES/HN.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/HN.po +17 -12
- holidays/locale/en_US/LC_MESSAGES/HU.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/HU.po +109 -0
- holidays/locale/en_US/LC_MESSAGES/IS.po +17 -17
- holidays/locale/en_US/LC_MESSAGES/JP.po +25 -25
- holidays/locale/en_US/LC_MESSAGES/KH.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/KH.po +139 -0
- holidays/locale/en_US/LC_MESSAGES/LI.po +22 -22
- holidays/locale/en_US/LC_MESSAGES/MC.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/MC.po +27 -27
- holidays/locale/en_US/LC_MESSAGES/MD.po +13 -13
- holidays/locale/en_US/LC_MESSAGES/MX.po +9 -12
- holidays/locale/en_US/LC_MESSAGES/NI.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/NI.po +15 -15
- holidays/locale/en_US/LC_MESSAGES/NL.po +12 -12
- holidays/locale/en_US/LC_MESSAGES/NO.po +13 -13
- holidays/locale/en_US/LC_MESSAGES/PE.po +30 -30
- holidays/locale/en_US/LC_MESSAGES/PL.po +38 -21
- holidays/locale/en_US/LC_MESSAGES/PT.po +39 -36
- holidays/locale/en_US/LC_MESSAGES/PY.po +16 -16
- holidays/locale/en_US/LC_MESSAGES/RO.po +12 -12
- holidays/locale/en_US/LC_MESSAGES/RS.mo +0 -0
- holidays/locale/en_US/LC_MESSAGES/RS.po +17 -19
- holidays/locale/en_US/LC_MESSAGES/RU.po +11 -10
- holidays/locale/en_US/LC_MESSAGES/SE.po +19 -19
- holidays/locale/en_US/LC_MESSAGES/SK.po +17 -18
- holidays/locale/en_US/LC_MESSAGES/TH.po +41 -41
- holidays/locale/en_US/LC_MESSAGES/UA.po +18 -19
- holidays/locale/en_US/LC_MESSAGES/UY.po +15 -15
- holidays/locale/en_US/LC_MESSAGES/VE.po +16 -16
- holidays/locale/es/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/es/LC_MESSAGES/AR.po +34 -33
- holidays/locale/es/LC_MESSAGES/CL.po +39 -38
- holidays/locale/es/LC_MESSAGES/CO.mo +0 -0
- holidays/locale/es/LC_MESSAGES/CO.po +24 -24
- holidays/locale/es/LC_MESSAGES/CR.mo +0 -0
- holidays/locale/es/LC_MESSAGES/CR.po +19 -19
- holidays/locale/es/LC_MESSAGES/CU.po +10 -10
- holidays/locale/es/LC_MESSAGES/DO.po +12 -12
- holidays/locale/es/LC_MESSAGES/EC.po +11 -12
- holidays/locale/es/LC_MESSAGES/HN.mo +0 -0
- holidays/locale/es/LC_MESSAGES/HN.po +17 -12
- holidays/locale/es/LC_MESSAGES/MX.po +9 -12
- holidays/locale/es/LC_MESSAGES/NI.po +12 -12
- holidays/locale/es/LC_MESSAGES/PE.po +30 -30
- holidays/locale/es/LC_MESSAGES/PY.po +16 -16
- holidays/locale/es/LC_MESSAGES/UY.po +15 -15
- holidays/locale/es/LC_MESSAGES/VE.po +16 -16
- holidays/locale/fi/LC_MESSAGES/FI.po +16 -16
- holidays/locale/fr/LC_MESSAGES/CA.po +43 -43
- holidays/locale/fr/LC_MESSAGES/CH.po +91 -56
- holidays/locale/fr/LC_MESSAGES/FR.po +27 -24
- holidays/locale/fr/LC_MESSAGES/MC.po +23 -23
- holidays/locale/hu/LC_MESSAGES/HU.mo +0 -0
- holidays/locale/hu/LC_MESSAGES/HU.po +109 -0
- holidays/locale/hy/LC_MESSAGES/AM.po +16 -16
- holidays/locale/is/LC_MESSAGES/IS.po +18 -18
- holidays/locale/it/LC_MESSAGES/CH.po +91 -56
- holidays/locale/ja/LC_MESSAGES/JP.po +25 -25
- holidays/locale/ka/LC_MESSAGES/GE.po +23 -27
- holidays/locale/km/LC_MESSAGES/KH.mo +0 -0
- holidays/locale/km/LC_MESSAGES/KH.po +139 -0
- holidays/locale/ms/LC_MESSAGES/BN.mo +0 -0
- holidays/locale/ms/LC_MESSAGES/BN.po +96 -0
- holidays/locale/nl/LC_MESSAGES/AW.mo +0 -0
- holidays/locale/nl/LC_MESSAGES/AW.po +87 -0
- holidays/locale/nl/LC_MESSAGES/CW.mo +0 -0
- holidays/locale/nl/LC_MESSAGES/CW.po +82 -0
- holidays/locale/nl/LC_MESSAGES/NL.po +13 -13
- holidays/locale/no/LC_MESSAGES/NO.po +14 -14
- holidays/locale/pap/LC_MESSAGES/AW.mo +0 -0
- holidays/locale/pap/LC_MESSAGES/AW.po +87 -0
- holidays/locale/pap/LC_MESSAGES/CW.mo +0 -0
- holidays/locale/pap/LC_MESSAGES/CW.po +82 -0
- holidays/locale/pl/LC_MESSAGES/PL.po +38 -21
- holidays/locale/pt_PT/LC_MESSAGES/PT.po +39 -36
- holidays/locale/ro/LC_MESSAGES/MD.po +14 -15
- holidays/locale/ro/LC_MESSAGES/RO.po +13 -14
- holidays/locale/ru/LC_MESSAGES/RU.po +11 -9
- holidays/locale/sk/LC_MESSAGES/SK.po +17 -18
- holidays/locale/sr/LC_MESSAGES/RS.mo +0 -0
- holidays/locale/sr/LC_MESSAGES/RS.po +15 -17
- holidays/locale/sv/LC_MESSAGES/FI.po +16 -16
- holidays/locale/sv/LC_MESSAGES/SE.po +20 -20
- holidays/locale/th/LC_MESSAGES/BN.mo +0 -0
- holidays/locale/th/LC_MESSAGES/BN.po +96 -0
- holidays/locale/th/LC_MESSAGES/CA.po +42 -42
- holidays/locale/th/LC_MESSAGES/KH.mo +0 -0
- holidays/locale/th/LC_MESSAGES/KH.po +145 -0
- holidays/locale/th/LC_MESSAGES/TH.po +41 -41
- holidays/locale/uk/LC_MESSAGES/AR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/AR.po +35 -35
- holidays/locale/uk/LC_MESSAGES/AT.po +15 -16
- holidays/locale/uk/LC_MESSAGES/AW.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/AW.po +87 -0
- holidays/locale/uk/LC_MESSAGES/CH.po +92 -58
- holidays/locale/uk/LC_MESSAGES/CL.po +40 -40
- holidays/locale/uk/LC_MESSAGES/CO.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CO.po +28 -29
- holidays/locale/uk/LC_MESSAGES/CR.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CR.po +20 -21
- holidays/locale/uk/LC_MESSAGES/CU.po +11 -12
- holidays/locale/uk/LC_MESSAGES/CW.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/CW.po +82 -0
- holidays/locale/uk/LC_MESSAGES/DE.po +33 -34
- holidays/locale/uk/LC_MESSAGES/DK.po +14 -14
- holidays/locale/uk/LC_MESSAGES/DO.po +13 -14
- holidays/locale/uk/LC_MESSAGES/EC.po +12 -14
- holidays/locale/uk/LC_MESSAGES/FI.po +17 -18
- holidays/locale/uk/LC_MESSAGES/FR.po +28 -26
- holidays/locale/uk/LC_MESSAGES/HN.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/HN.po +18 -14
- holidays/locale/uk/LC_MESSAGES/HU.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/HU.po +109 -0
- holidays/locale/uk/LC_MESSAGES/IS.po +19 -20
- holidays/locale/uk/LC_MESSAGES/LI.po +24 -25
- holidays/locale/uk/LC_MESSAGES/MC.po +27 -28
- holidays/locale/uk/LC_MESSAGES/MD.po +14 -15
- holidays/locale/uk/LC_MESSAGES/MX.po +10 -14
- holidays/locale/uk/LC_MESSAGES/NI.mo +0 -0
- holidays/locale/uk/LC_MESSAGES/NI.po +16 -17
- holidays/locale/uk/LC_MESSAGES/NL.po +14 -15
- holidays/locale/uk/LC_MESSAGES/NO.po +15 -16
- holidays/locale/uk/LC_MESSAGES/PE.po +31 -32
- holidays/locale/uk/LC_MESSAGES/PL.po +38 -21
- holidays/locale/uk/LC_MESSAGES/PY.po +17 -18
- holidays/locale/uk/LC_MESSAGES/RO.po +13 -14
- holidays/locale/uk/LC_MESSAGES/SE.po +21 -22
- holidays/locale/uk/LC_MESSAGES/SK.po +18 -20
- holidays/locale/uk/LC_MESSAGES/UA.po +17 -17
- holidays/locale/uk/LC_MESSAGES/UY.po +16 -17
- holidays/locale/uk/LC_MESSAGES/VE.po +17 -18
- holidays/registry.py +21 -12
- holidays/utils.py +87 -17
- {holidays-0.25.dist-info → holidays-0.27.dist-info}/METADATA +282 -265
- holidays-0.27.dist-info/RECORD +449 -0
- holidays-0.25.dist-info/RECORD +0 -390
- {holidays-0.25.dist-info → holidays-0.27.dist-info}/LICENSE +0 -0
- {holidays-0.25.dist-info → holidays-0.27.dist-info}/WHEEL +0 -0
- {holidays-0.25.dist-info → holidays-0.27.dist-info}/top_level.txt +0 -0
holidays/calendars/thai.py
CHANGED
|
@@ -14,8 +14,12 @@ from datetime import timedelta as td
|
|
|
14
14
|
from functools import lru_cache
|
|
15
15
|
from typing import Optional
|
|
16
16
|
|
|
17
|
+
# Manual Assign to avoid circular import
|
|
18
|
+
KHMER_CALENDAR = "KHMER_CALENDAR"
|
|
19
|
+
THAI_CALENDAR = "THAI_CALENDAR"
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
|
|
22
|
+
class _ThaiLunisolar:
|
|
19
23
|
"""
|
|
20
24
|
** Thai Lunar Calendar Holidays only work from 1941 (B.E. 2484) onwards
|
|
21
25
|
until 2057 (B.E. 2600) as we only have Thai year-type data for
|
|
@@ -25,7 +29,7 @@ class _ThaiLuniSolar:
|
|
|
25
29
|
3-year types for calendar intercalation:
|
|
26
30
|
- Pakatimat (Normal Year):
|
|
27
31
|
consist of 12 months, has 354 days.
|
|
28
|
-
- Athikawan (Extra-Day Year):
|
|
32
|
+
- Athikawan (Extra-Day Year):
|
|
29
33
|
add a day to the 7th month of the year, has 355 days
|
|
30
34
|
for the synodic month correction.
|
|
31
35
|
- Athikamat (Extra-Month Year):
|
|
@@ -41,27 +45,40 @@ class _ThaiLuniSolar:
|
|
|
41
45
|
the usual calendar by 1 month.
|
|
42
46
|
|
|
43
47
|
List of public holidays dependent on the Thai Lunar Calendar:
|
|
44
|
-
- Magha Puja/Makha Bucha:
|
|
48
|
+
- Magha Puja/Makha Bucha/Meak Bochea:
|
|
45
49
|
15th Waxing Day (Full Moon) of Month 3
|
|
46
50
|
(On Month 4 for Athikamat Years).
|
|
47
|
-
|
|
51
|
+
KHMER_CALENDAR always fall on Month 3.
|
|
52
|
+
- Vesak/Visakha Bucha/Visaka Bochea:
|
|
53
|
+
15th Waxing Day (Full Moon) of Month 6
|
|
54
|
+
(On Month 7 for Athikamat Years).
|
|
55
|
+
KHMER_CALENDAR always fall on Month 6.
|
|
56
|
+
- Thai Royal Ploughing Ceremony/Raeknakhwan:
|
|
48
57
|
Based on this, though Court Astrologer picks the
|
|
49
58
|
auspicious dates, which sadly don't fall into a
|
|
50
59
|
predictable pattern; see its specific section below.
|
|
51
|
-
-
|
|
52
|
-
|
|
60
|
+
- Cambodian Royal Ploughing Ceremony/Preah Neangkol:
|
|
61
|
+
4th Waning Day of Month 6
|
|
53
62
|
(On Month 7 for Athikamat Years).
|
|
63
|
+
This defaults to KHMER_CALENDAR (its sole user).
|
|
54
64
|
- Asalha Puja/Asarnha Bucha:
|
|
55
65
|
15th Waxing Day (Full Moon) of Month 8
|
|
56
66
|
(On Month 8/8 for Athikamat Years).
|
|
67
|
+
KHMER_CALENDAR always fall on Month 8.
|
|
57
68
|
- Buddhist Lent Day/Wan Khao Phansa:
|
|
58
69
|
1st Waning Day of Month 8
|
|
59
70
|
(On Month 8/8 for Athikamat Years).
|
|
71
|
+
KHMER_CALENDAR always fall on Month 8.
|
|
72
|
+
- Pchum Ben/Prachum Bandar:
|
|
73
|
+
15th Waning Day (New Moon) of Month 10.
|
|
74
|
+
- Loy Krathong/Boun That Louang/Bon Om Touk:
|
|
75
|
+
15th Waxing Day (Full Moon) of Month 12.
|
|
60
76
|
|
|
61
77
|
Other Buddhist date on Thai Lunar Calendar:
|
|
62
78
|
- Buddha's Cremation Day/Atthami Bucha
|
|
63
79
|
8th Waning Day of Month 6
|
|
64
80
|
(On Month 7 for Athikamat Years).
|
|
81
|
+
KHMER_CALENDAR always fall on Month 6
|
|
65
82
|
- End of Buddhist Lent Day/Ok Phansa:
|
|
66
83
|
15th Waxing Day (Full Moon) of Month 11
|
|
67
84
|
|
|
@@ -76,8 +93,8 @@ class _ThaiLuniSolar:
|
|
|
76
93
|
|
|
77
94
|
Usage example:
|
|
78
95
|
|
|
79
|
-
>>> from holidays.utils import
|
|
80
|
-
>>> thls =
|
|
96
|
+
>>> from holidays.utils import _ThaiLunisolar
|
|
97
|
+
>>> thls = _ThaiLunisolar()
|
|
81
98
|
>>> print(thls.visakha_bucha_date(2010))
|
|
82
99
|
2010-05-28
|
|
83
100
|
"""
|
|
@@ -167,6 +184,28 @@ class _ThaiLuniSolar:
|
|
|
167
184
|
START_YEAR = 1941
|
|
168
185
|
END_YEAR = 2057
|
|
169
186
|
|
|
187
|
+
def __init__(self, calendar=THAI_CALENDAR) -> None:
|
|
188
|
+
self.__verify_calendar(calendar)
|
|
189
|
+
self.__calendar = calendar
|
|
190
|
+
|
|
191
|
+
@staticmethod
|
|
192
|
+
def __is_khmer_calendar(calendar):
|
|
193
|
+
"""
|
|
194
|
+
Return True if `calendar` is Khmer calendar.
|
|
195
|
+
Return False otherwise.
|
|
196
|
+
"""
|
|
197
|
+
return calendar == KHMER_CALENDAR
|
|
198
|
+
|
|
199
|
+
@staticmethod
|
|
200
|
+
def __verify_calendar(calendar):
|
|
201
|
+
"""
|
|
202
|
+
Verify calendar type.
|
|
203
|
+
"""
|
|
204
|
+
if calendar not in {KHMER_CALENDAR, THAI_CALENDAR}:
|
|
205
|
+
raise ValueError(
|
|
206
|
+
f"Unknown calendar name: {calendar}. Use `KHMER_CALENDAR` or `THAI_CALENDAR`."
|
|
207
|
+
)
|
|
208
|
+
|
|
170
209
|
@lru_cache()
|
|
171
210
|
def _get_start_date(self, year: int) -> Optional[date]:
|
|
172
211
|
"""
|
|
@@ -181,16 +220,16 @@ class _ThaiLuniSolar:
|
|
|
181
220
|
:return:
|
|
182
221
|
The start date of Thai Lunar Calendar for a Gregorian year.
|
|
183
222
|
"""
|
|
184
|
-
if year <
|
|
223
|
+
if year < _ThaiLunisolar.START_YEAR or year > _ThaiLunisolar.END_YEAR:
|
|
185
224
|
return None
|
|
186
225
|
|
|
187
|
-
iter_start_date =
|
|
188
|
-
iter_start_year =
|
|
226
|
+
iter_start_date = _ThaiLunisolar.START_DATE
|
|
227
|
+
iter_start_year = _ThaiLunisolar.START_YEAR
|
|
189
228
|
|
|
190
229
|
while iter_start_year < year:
|
|
191
|
-
if iter_start_year in
|
|
230
|
+
if iter_start_year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN:
|
|
192
231
|
delta_days = 384
|
|
193
|
-
elif iter_start_year in
|
|
232
|
+
elif iter_start_year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN:
|
|
194
233
|
delta_days = 355
|
|
195
234
|
else:
|
|
196
235
|
delta_days = 354
|
|
@@ -198,14 +237,16 @@ class _ThaiLuniSolar:
|
|
|
198
237
|
iter_start_year += 1
|
|
199
238
|
return iter_start_date
|
|
200
239
|
|
|
201
|
-
def makha_bucha_date(self, year: int) -> Optional[date]:
|
|
240
|
+
def makha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
|
|
202
241
|
"""
|
|
203
242
|
Calculate the estimated Gregorian date of Makha Bucha.
|
|
204
|
-
If the Gregorian year input is
|
|
243
|
+
If the Gregorian year input is invalid, this will outputs None instead.
|
|
244
|
+
|
|
245
|
+
Also known as "Magha Puja", "Makha Buxha" and "Meak Bochea".
|
|
246
|
+
This concides with the 15th Waxing Day of Month 3
|
|
247
|
+
in Thai Lunar Calendar, or Month 4 in Athikamat years.
|
|
205
248
|
|
|
206
|
-
|
|
207
|
-
the 15th Waxing Day of Month 3 in Thai Lunar Calendar,
|
|
208
|
-
or Month 4 in Athikamat years.
|
|
249
|
+
KHMER_CALENDAR will always use Month 3 regardless of year type.
|
|
209
250
|
|
|
210
251
|
To calculate, we use use the following time delta:
|
|
211
252
|
- Athikamat: 15th Waxing Day of Month 4
|
|
@@ -218,30 +259,41 @@ class _ThaiLuniSolar:
|
|
|
218
259
|
:param year:
|
|
219
260
|
The Gregorian year.
|
|
220
261
|
|
|
262
|
+
:param calendar:
|
|
263
|
+
Calendar type, this defaults to THAI_CALENDAR.
|
|
264
|
+
|
|
221
265
|
:return:
|
|
222
266
|
Estimated Gregorian date of Makha Bucha.
|
|
223
267
|
"""
|
|
268
|
+
calendar = calendar or self.__calendar
|
|
269
|
+
self.__verify_calendar(calendar)
|
|
270
|
+
|
|
224
271
|
start_date = self._get_start_date(year)
|
|
225
272
|
if not start_date:
|
|
226
273
|
return None
|
|
227
274
|
|
|
228
275
|
return start_date + td(
|
|
229
276
|
days=+102
|
|
230
|
-
if
|
|
277
|
+
if (
|
|
278
|
+
year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN
|
|
279
|
+
and not self.__is_khmer_calendar(calendar)
|
|
280
|
+
)
|
|
231
281
|
else +73
|
|
232
282
|
)
|
|
233
283
|
|
|
234
|
-
def visakha_bucha_date(self, year: int) -> Optional[date]:
|
|
284
|
+
def visakha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
|
|
235
285
|
"""
|
|
236
286
|
Calculate the estimated Gregorian date of Visakha Bucha.
|
|
237
|
-
If the Gregorian year input is
|
|
287
|
+
If the Gregorian year input is invalid, this will outputs None instead.
|
|
238
288
|
|
|
239
289
|
Also known as "Vesak" and "Buddha Day". This concides with
|
|
240
290
|
the 15th Waxing Day of Month 6 in Thai Lunar Calendar,
|
|
241
291
|
or Month 7 in Athikamat years.
|
|
242
292
|
|
|
293
|
+
KHMER_CALENDAR will always use Month 6 regardless of year type.
|
|
294
|
+
|
|
243
295
|
To calculate, we use use the following time delta:
|
|
244
|
-
- Athikamat: 15th Waxing Day of Month
|
|
296
|
+
- Athikamat: 15th Waxing Day of Month 7
|
|
245
297
|
or 177[1-6] + 15[7] -1 = 191
|
|
246
298
|
- Athikawan: 15th Waxing Day of Month 6
|
|
247
299
|
or 147[1-5] + 15[6] -1 = 161
|
|
@@ -251,28 +303,68 @@ class _ThaiLuniSolar:
|
|
|
251
303
|
:param year:
|
|
252
304
|
The Gregorian year.
|
|
253
305
|
|
|
306
|
+
:param calendar:
|
|
307
|
+
Calendar type, this defaults to THAI_CALENDAR.
|
|
308
|
+
|
|
254
309
|
:return:
|
|
255
310
|
Estimated Gregorian date of Visakha Bucha.
|
|
256
311
|
"""
|
|
312
|
+
calendar = calendar or self.__calendar
|
|
313
|
+
self.__verify_calendar(calendar)
|
|
314
|
+
|
|
257
315
|
start_date = self._get_start_date(year)
|
|
258
316
|
if not start_date:
|
|
259
317
|
return None
|
|
260
318
|
|
|
261
319
|
return start_date + td(
|
|
262
320
|
days=+191
|
|
263
|
-
if
|
|
321
|
+
if (
|
|
322
|
+
year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN
|
|
323
|
+
and not self.__is_khmer_calendar(calendar)
|
|
324
|
+
)
|
|
264
325
|
else +161
|
|
265
326
|
)
|
|
266
327
|
|
|
267
|
-
def
|
|
328
|
+
def preah_neangkoal_date(self, year: int) -> Optional[date]:
|
|
329
|
+
"""
|
|
330
|
+
Calculate the estimated Gregorian date of Preah Neangkoal.
|
|
331
|
+
If the Gregorian year input is invalid, this will outputs None instead.
|
|
332
|
+
|
|
333
|
+
Also known as "Cambodian Royal Ploughing Ceremony". This always
|
|
334
|
+
concides with the 4th Waning Day of Month 6 in Khmer Lunar Calendar.
|
|
335
|
+
|
|
336
|
+
To calculate, we use use the following time delta:
|
|
337
|
+
- Athikamat: 15th Waxing Day of Month 6
|
|
338
|
+
or 177[1-6] + 19[7] -1 = 165
|
|
339
|
+
- Athikawan: 15th Waxing Day of Month 6
|
|
340
|
+
or 147[1-5] + 19[6] -1 = 165
|
|
341
|
+
- Pakatimat: 15th Waxing Day of Month 6
|
|
342
|
+
or 147[1-5] + 19[6] -1 = 165
|
|
343
|
+
Or as in simpler terms: "Visakha Bucha" +4
|
|
344
|
+
|
|
345
|
+
:param year:
|
|
346
|
+
The Gregorian year.
|
|
347
|
+
|
|
348
|
+
:return:
|
|
349
|
+
Estimated Gregorian date of Preah Neangkoal.
|
|
350
|
+
"""
|
|
351
|
+
start_date = self._get_start_date(year)
|
|
352
|
+
if not start_date:
|
|
353
|
+
return None
|
|
354
|
+
|
|
355
|
+
return start_date + td(days=+165)
|
|
356
|
+
|
|
357
|
+
def atthami_bucha_date(self, year: int, calendar=None) -> Optional[date]:
|
|
268
358
|
"""
|
|
269
359
|
Calculate the estimated Gregorian date of Atthami Bucha.
|
|
270
|
-
If the Gregorian year input is
|
|
360
|
+
If the Gregorian year input is invalid, this will outputs None instead.
|
|
271
361
|
|
|
272
362
|
Also known as "Buddha's Cremation Day". This concides with
|
|
273
363
|
the 8th Waning Day of Month 6 in Thai Lunar Calendar,
|
|
274
364
|
or Month 7 in Athikamat years.
|
|
275
365
|
|
|
366
|
+
KHMER_CALENDAR will always use Month 6 regardless of year type.
|
|
367
|
+
|
|
276
368
|
To calculate, we use use the following time delta:
|
|
277
369
|
- Athikamat: 8th Waning Day of Month 7
|
|
278
370
|
or 177[1-6] + 23[7] -1 = 199
|
|
@@ -285,28 +377,39 @@ class _ThaiLuniSolar:
|
|
|
285
377
|
:param year:
|
|
286
378
|
The Gregorian year.
|
|
287
379
|
|
|
380
|
+
:param calendar:
|
|
381
|
+
Calendar type, this defaults to THAI_CALENDAR.
|
|
382
|
+
|
|
288
383
|
:return:
|
|
289
384
|
Estimated Gregorian date of Atthami Bucha.
|
|
290
385
|
"""
|
|
386
|
+
calendar = calendar or self.__calendar
|
|
387
|
+
self.__verify_calendar(calendar)
|
|
388
|
+
|
|
291
389
|
start_date = self._get_start_date(year)
|
|
292
390
|
if not start_date:
|
|
293
391
|
return None
|
|
294
392
|
|
|
295
393
|
return start_date + td(
|
|
296
394
|
days=+199
|
|
297
|
-
if
|
|
395
|
+
if (
|
|
396
|
+
year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN
|
|
397
|
+
and not self.__is_khmer_calendar(calendar)
|
|
398
|
+
)
|
|
298
399
|
else +169
|
|
299
400
|
)
|
|
300
401
|
|
|
301
|
-
def asarnha_bucha_date(self, year: int) -> Optional[date]:
|
|
402
|
+
def asarnha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
|
|
302
403
|
"""
|
|
303
404
|
Calculate the estimated Gregorian date of Asarnha Bucha.
|
|
304
|
-
If the Gregorian year input is
|
|
405
|
+
If the Gregorian year input is invalid, this will outputs None instead.
|
|
305
406
|
|
|
306
407
|
Also known as "Asalha Puja". This concides with
|
|
307
408
|
the 15th Waxing Day of Month 8 in Thai Lunar Calendar,
|
|
308
409
|
or Month 8.8 in Athikamat years.
|
|
309
410
|
|
|
411
|
+
KHMER_CALENDAR will always use Month 8 regardless of year type.
|
|
412
|
+
|
|
310
413
|
To calculate, we use use the following time delta:
|
|
311
414
|
- Athikamat: 15th Waxing Day of Month 8/8
|
|
312
415
|
or 177[1-6] + 29[7] + 30[8] + 15[8.8] -1 = 250
|
|
@@ -318,30 +421,40 @@ class _ThaiLuniSolar:
|
|
|
318
421
|
:param year:
|
|
319
422
|
The Gregorian year.
|
|
320
423
|
|
|
424
|
+
:param calendar:
|
|
425
|
+
Calendar type, this defaults to THAI_CALENDAR.
|
|
426
|
+
|
|
321
427
|
:return:
|
|
322
428
|
Estimated Gregorian date of Asarnha Bucha.
|
|
323
429
|
"""
|
|
430
|
+
calendar = calendar or self.__calendar
|
|
431
|
+
self.__verify_calendar(calendar)
|
|
432
|
+
|
|
324
433
|
start_date = self._get_start_date(year)
|
|
325
434
|
if not start_date:
|
|
326
435
|
return None
|
|
327
436
|
|
|
328
|
-
if year in
|
|
437
|
+
if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN and not self.__is_khmer_calendar(
|
|
438
|
+
calendar
|
|
439
|
+
):
|
|
329
440
|
delta_days = 250
|
|
330
|
-
elif year in
|
|
441
|
+
elif year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN:
|
|
331
442
|
delta_days = 221
|
|
332
443
|
else:
|
|
333
444
|
delta_days = 220
|
|
334
445
|
return start_date + td(days=delta_days)
|
|
335
446
|
|
|
336
|
-
def khao_phansa_date(self, year: int) -> Optional[date]:
|
|
447
|
+
def khao_phansa_date(self, year: int, calendar=None) -> Optional[date]:
|
|
337
448
|
"""
|
|
338
449
|
Calculate the estimated Gregorian date of Khao Phansa.
|
|
339
|
-
If the Gregorian year input is
|
|
450
|
+
If the Gregorian year input is invalid, this will outputs None instead.
|
|
340
451
|
|
|
341
452
|
Also known as "(Start of) Buddhist Lent" and "Start of Vassa".
|
|
342
453
|
This concides with the 1st Waning Day of Month 8
|
|
343
454
|
in Thai Lunar Calendar, or Month 8.8 in Athikamat years.
|
|
344
455
|
|
|
456
|
+
KHMER_CALENDAR will always use Month 8 regardless of year type.
|
|
457
|
+
|
|
345
458
|
To calculate, we use use the following time delta:
|
|
346
459
|
- Athikamat: 1st Waning Day of Month 8.8
|
|
347
460
|
or 177[1-6] + 29[7] + 30[8] + 16[8.8] -1 = 251
|
|
@@ -354,25 +467,68 @@ class _ThaiLuniSolar:
|
|
|
354
467
|
:param year:
|
|
355
468
|
The Gregorian year.
|
|
356
469
|
|
|
470
|
+
:param calendar:
|
|
471
|
+
Calendar type, this defaults to THAI_CALENDAR.
|
|
472
|
+
|
|
357
473
|
:return:
|
|
358
474
|
Estimated Gregorian date of Khao Phansa.
|
|
359
475
|
"""
|
|
476
|
+
calendar = calendar or self.__calendar
|
|
477
|
+
self.__verify_calendar(calendar)
|
|
478
|
+
|
|
360
479
|
start_date = self._get_start_date(year)
|
|
361
480
|
if not start_date:
|
|
362
481
|
return None
|
|
363
482
|
|
|
364
|
-
if year in
|
|
483
|
+
if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN and not self.__is_khmer_calendar(
|
|
484
|
+
calendar
|
|
485
|
+
):
|
|
365
486
|
delta_days = 251
|
|
366
|
-
elif year in
|
|
487
|
+
elif year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN:
|
|
367
488
|
delta_days = 222
|
|
368
489
|
else:
|
|
369
490
|
delta_days = 221
|
|
370
491
|
return start_date + td(days=delta_days)
|
|
371
492
|
|
|
493
|
+
def pchum_ben_date(self, year: int) -> Optional[date]:
|
|
494
|
+
"""
|
|
495
|
+
Calculate the estimated Gregorian date of Pchum Ben.
|
|
496
|
+
If the Gregorian year input is invalid, this will outputs None instead.
|
|
497
|
+
|
|
498
|
+
Also known as "Prachum Bandar".
|
|
499
|
+
This concides with the 15th Waning Day of Month 10 in
|
|
500
|
+
Thai Lunar Calendar.
|
|
501
|
+
|
|
502
|
+
To calculate, we use use the following time delta:
|
|
503
|
+
- Athikamat: 15th Waning Day of Month 10
|
|
504
|
+
or 265[1-9] + 30[8.8] + 30[10] -1 = 324
|
|
505
|
+
- Athikawan: 15th Waning Day of Month 10
|
|
506
|
+
or 265[1-9] + 1[7] + 30[10] -1 = 295
|
|
507
|
+
- Pakatimat: 15th Waning Day of Month 10
|
|
508
|
+
or 265[1-9] + 30[10] -1 = 294
|
|
509
|
+
|
|
510
|
+
:param year:
|
|
511
|
+
The Gregorian year.
|
|
512
|
+
|
|
513
|
+
:return:
|
|
514
|
+
Estimated Gregorian date of Pchum Ben.
|
|
515
|
+
"""
|
|
516
|
+
start_date = self._get_start_date(year)
|
|
517
|
+
if not start_date:
|
|
518
|
+
return None
|
|
519
|
+
|
|
520
|
+
if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN:
|
|
521
|
+
delta_days = 324
|
|
522
|
+
elif year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN:
|
|
523
|
+
delta_days = 295
|
|
524
|
+
else:
|
|
525
|
+
delta_days = 294
|
|
526
|
+
return start_date + td(days=delta_days)
|
|
527
|
+
|
|
372
528
|
def ok_phansa_date(self, year: int) -> Optional[date]:
|
|
373
529
|
"""
|
|
374
|
-
Calculate the estimated Gregorian date of Ok Phansa
|
|
375
|
-
If the Gregorian year input is
|
|
530
|
+
Calculate the estimated Gregorian date of Ok Phansa.
|
|
531
|
+
If the Gregorian year input is invalid, this will outputs None instead.
|
|
376
532
|
|
|
377
533
|
Also known as "End of Buddhist Lent" and "End of Vassa".
|
|
378
534
|
This concides with the 15th Waxing Day of Month 11
|
|
@@ -396,10 +552,45 @@ class _ThaiLuniSolar:
|
|
|
396
552
|
if not start_date:
|
|
397
553
|
return None
|
|
398
554
|
|
|
399
|
-
if year in
|
|
555
|
+
if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN:
|
|
400
556
|
delta_days = 339
|
|
401
|
-
elif year in
|
|
557
|
+
elif year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN:
|
|
402
558
|
delta_days = 310
|
|
403
559
|
else:
|
|
404
560
|
delta_days = 309
|
|
405
561
|
return start_date + td(days=delta_days)
|
|
562
|
+
|
|
563
|
+
def loy_krathong_date(self, year: int) -> Optional[date]:
|
|
564
|
+
"""
|
|
565
|
+
Calculate the estimated Gregorian date of Loy Krathong.
|
|
566
|
+
If the Gregorian year input is invalid, this will outputs None instead.
|
|
567
|
+
|
|
568
|
+
Also known as "Boun That Louang" and "Bon Om Touk".
|
|
569
|
+
This concides with the 15th Waxing Day of Month 12
|
|
570
|
+
in Thai Lunar Calendar.
|
|
571
|
+
|
|
572
|
+
To calculate, we use use the following time delta:
|
|
573
|
+
- Athikamat: 15th Waxing Day of Month 12
|
|
574
|
+
or 324[1-11] + 30[8.8] + 15[11] -1 = 368
|
|
575
|
+
- Athikawan: 15th Waxing Day of Month 12
|
|
576
|
+
or 324[1-11] + 1[7] + 15[11] -1 = 339
|
|
577
|
+
- Pakatimat: 15th Waxing Day of Month 12
|
|
578
|
+
or 324[1-11] + 15[11] -1 = 338
|
|
579
|
+
|
|
580
|
+
:param year:
|
|
581
|
+
The Gregorian year.
|
|
582
|
+
|
|
583
|
+
:return:
|
|
584
|
+
Estimated Gregorian date of Loy Krathong.
|
|
585
|
+
"""
|
|
586
|
+
start_date = self._get_start_date(year)
|
|
587
|
+
if not start_date:
|
|
588
|
+
return None
|
|
589
|
+
|
|
590
|
+
if year in _ThaiLunisolar.ATHIKAMAT_YEARS_GREGORIAN:
|
|
591
|
+
delta_days = 368
|
|
592
|
+
elif year in _ThaiLunisolar.ATHIKAWAN_YEARS_GREGORIAN:
|
|
593
|
+
delta_days = 339
|
|
594
|
+
else:
|
|
595
|
+
delta_days = 338
|
|
596
|
+
return start_date + td(days=delta_days)
|
holidays/countries/__init__.py
CHANGED
|
@@ -24,13 +24,19 @@ from .bahrain import Bahrain, BH, BAH
|
|
|
24
24
|
from .bangladesh import Bangladesh, BD, BGD
|
|
25
25
|
from .belarus import Belarus, BY, BLR
|
|
26
26
|
from .belgium import Belgium, BE, BEL
|
|
27
|
+
from .belize import Belize, BZ, BLZ
|
|
27
28
|
from .bolivia import Bolivia, BO, BOL
|
|
28
29
|
from .bosnia_and_herzegovina import BosniaAndHerzegovina, BA, BIH
|
|
29
30
|
from .botswana import Botswana, BW, BWA
|
|
30
31
|
from .brazil import Brazil, BR, BRA
|
|
32
|
+
from .brunei import Brunei, BN, BRN
|
|
31
33
|
from .bulgaria import Bulgaria, BG, BLG
|
|
34
|
+
from .burkina_faso import BurkinaFaso, BF, BFA
|
|
32
35
|
from .burundi import Burundi, BI, BDI
|
|
36
|
+
from .cambodia import Cambodia, KH, KHM
|
|
37
|
+
from .cameroon import Cameroon, CM, CMR
|
|
33
38
|
from .canada import Canada, CA, CAN
|
|
39
|
+
from .chad import Chad, TD, TCD
|
|
34
40
|
from .chile import Chile, CL, CHL
|
|
35
41
|
from .china import China, CN, CHN
|
|
36
42
|
from .colombia import Colombia, CO, COL
|
|
@@ -45,11 +51,13 @@ from .djibouti import Djibouti, DJ, DJI
|
|
|
45
51
|
from .dominican_republic import DominicanRepublic, DO, DOM
|
|
46
52
|
from .ecuador import Ecuador, EC, ECU
|
|
47
53
|
from .egypt import Egypt, EG, EGY
|
|
54
|
+
from .el_salvador import ElSalvador, SV, SLV
|
|
48
55
|
from .estonia import Estonia, EE, EST
|
|
49
56
|
from .eswatini import Eswatini, SZ, SZW, Swaziland
|
|
50
57
|
from .ethiopia import Ethiopia, ET, ETH
|
|
51
58
|
from .finland import Finland, FI, FIN
|
|
52
59
|
from .france import France, FR, FRA
|
|
60
|
+
from .gabon import Gabon, GA, GAB
|
|
53
61
|
from .georgia import Georgia, GE, GEO
|
|
54
62
|
from .germany import Germany, DE, DEU
|
|
55
63
|
from .greece import Greece, GR, GRC
|
holidays/countries/albania.py
CHANGED
|
@@ -14,13 +14,10 @@ from datetime import timedelta as td
|
|
|
14
14
|
from holidays.calendars import JULIAN_CALENDAR
|
|
15
15
|
from holidays.constants import JAN, MAR, SEP, OCT, NOV, DEC
|
|
16
16
|
from holidays.holiday_base import HolidayBase
|
|
17
|
-
from holidays.holiday_groups import ChristianHolidays, IslamicHolidays
|
|
18
|
-
from holidays.holiday_groups import InternationalHolidays
|
|
17
|
+
from holidays.holiday_groups import ChristianHolidays, IslamicHolidays, InternationalHolidays
|
|
19
18
|
|
|
20
19
|
|
|
21
|
-
class Albania(
|
|
22
|
-
HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays
|
|
23
|
-
):
|
|
20
|
+
class Albania(HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays):
|
|
24
21
|
"""
|
|
25
22
|
References:
|
|
26
23
|
- https://en.wikipedia.org/wiki/Public_holidays_in_Albania
|
|
@@ -56,22 +53,16 @@ class Albania(
|
|
|
56
53
|
|
|
57
54
|
# Easter.
|
|
58
55
|
observed_dates.add(self._add_easter_sunday("Catholic Easter"))
|
|
59
|
-
observed_dates.add(
|
|
60
|
-
self._add_easter_sunday("Orthodox Easter", JULIAN_CALENDAR)
|
|
61
|
-
)
|
|
56
|
+
observed_dates.add(self._add_easter_sunday("Orthodox Easter", JULIAN_CALENDAR))
|
|
62
57
|
|
|
63
58
|
# May Day.
|
|
64
59
|
observed_dates.add(self._add_labor_day("May Day"))
|
|
65
60
|
|
|
66
61
|
# Mother Teresa Day.
|
|
67
62
|
if 2004 <= year <= 2017:
|
|
68
|
-
observed_dates.add(
|
|
69
|
-
self._add_holiday("Mother Teresa Beatification Day", OCT, 19)
|
|
70
|
-
)
|
|
63
|
+
observed_dates.add(self._add_holiday("Mother Teresa Beatification Day", OCT, 19))
|
|
71
64
|
elif year >= 2018:
|
|
72
|
-
observed_dates.add(
|
|
73
|
-
self._add_holiday("Mother Teresa Canonization Day", SEP, 5)
|
|
74
|
-
)
|
|
65
|
+
observed_dates.add(self._add_holiday("Mother Teresa Canonization Day", SEP, 5))
|
|
75
66
|
|
|
76
67
|
# Independence Day.
|
|
77
68
|
observed_dates.add(self._add_holiday("Independence Day", NOV, 28))
|
|
@@ -100,9 +91,7 @@ class Albania(
|
|
|
100
91
|
while self._is_weekend(obs_date) or obs_date in observed_dates:
|
|
101
92
|
obs_date += td(days=+1)
|
|
102
93
|
for hol_name in self.get_list(hol_date):
|
|
103
|
-
observed_dates.add(
|
|
104
|
-
self._add_holiday("%s (Observed)" % hol_name, obs_date)
|
|
105
|
-
)
|
|
94
|
+
observed_dates.add(self._add_holiday("%s (Observed)" % hol_name, obs_date))
|
|
106
95
|
|
|
107
96
|
# observed holidays special cases
|
|
108
97
|
if year == 2007:
|
holidays/countries/andorra.py
CHANGED
|
@@ -115,9 +115,7 @@ class Andorra(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
115
115
|
# Sant Julià de Lòria.
|
|
116
116
|
def _add_subdiv_06_holidays(self):
|
|
117
117
|
name = "Sant Julià de Lòria Annual Festival"
|
|
118
|
-
last_fri_of_july = _get_nth_weekday_from(
|
|
119
|
-
-1, FRI, date(self._year, JUL, 29)
|
|
120
|
-
)
|
|
118
|
+
last_fri_of_july = _get_nth_weekday_from(-1, FRI, date(self._year, JUL, 29))
|
|
121
119
|
self._add_holiday(name, last_fri_of_july)
|
|
122
120
|
self._add_holiday(name, last_fri_of_july + td(days=+1))
|
|
123
121
|
self._add_holiday(name, last_fri_of_july + td(days=+2))
|
|
@@ -126,9 +124,7 @@ class Andorra(HolidayBase, ChristianHolidays, InternationalHolidays):
|
|
|
126
124
|
# Andorra la Vella.
|
|
127
125
|
def _add_subdiv_07_holidays(self):
|
|
128
126
|
name = "Andorra la Vella Annual Festival"
|
|
129
|
-
first_sat_of_august = _get_nth_weekday_of_month(
|
|
130
|
-
1, SAT, AUG, self._year
|
|
131
|
-
)
|
|
127
|
+
first_sat_of_august = _get_nth_weekday_of_month(1, SAT, AUG, self._year)
|
|
132
128
|
self._add_holiday(name, first_sat_of_august)
|
|
133
129
|
self._add_holiday(name, first_sat_of_august + td(days=+1))
|
|
134
130
|
self._add_holiday(name, first_sat_of_august + td(days=+2))
|