holidays 0.68__py3-none-any.whl → 0.70__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 (254) hide show
  1. holidays/__init__.py +1 -1
  2. holidays/calendars/__init__.py +2 -1
  3. holidays/calendars/balinese_saka.py +112 -0
  4. holidays/calendars/buddhist.py +1 -1
  5. holidays/calendars/chinese.py +1 -1
  6. holidays/calendars/custom.py +1 -1
  7. holidays/calendars/gregorian.py +1 -1
  8. holidays/calendars/hebrew.py +1 -1
  9. holidays/calendars/hindu.py +866 -2
  10. holidays/calendars/islamic.py +161 -1
  11. holidays/calendars/julian.py +1 -1
  12. holidays/calendars/julian_revised.py +1 -1
  13. holidays/calendars/persian.py +1 -1
  14. holidays/calendars/sinhala.py +1 -1
  15. holidays/calendars/thai.py +309 -257
  16. holidays/constants.py +3 -1
  17. holidays/countries/__init__.py +7 -1
  18. holidays/countries/afghanistan.py +17 -7
  19. holidays/countries/albania.py +16 -7
  20. holidays/countries/algeria.py +14 -10
  21. holidays/countries/american_samoa.py +12 -6
  22. holidays/countries/andorra.py +5 -4
  23. holidays/countries/angola.py +15 -14
  24. holidays/countries/antigua_and_barbuda.py +145 -0
  25. holidays/countries/argentina.py +787 -169
  26. holidays/countries/armenia.py +5 -6
  27. holidays/countries/aruba.py +11 -9
  28. holidays/countries/australia.py +21 -20
  29. holidays/countries/austria.py +3 -1
  30. holidays/countries/azerbaijan.py +30 -19
  31. holidays/countries/bahamas.py +13 -11
  32. holidays/countries/bahrain.py +14 -7
  33. holidays/countries/bangladesh.py +5 -4
  34. holidays/countries/barbados.py +11 -9
  35. holidays/countries/belarus.py +15 -15
  36. holidays/countries/belgium.py +8 -6
  37. holidays/countries/belize.py +7 -6
  38. holidays/countries/bolivia.py +12 -11
  39. holidays/countries/bosnia_and_herzegovina.py +21 -11
  40. holidays/countries/botswana.py +8 -6
  41. holidays/countries/brazil.py +8 -7
  42. holidays/countries/brunei.py +56 -62
  43. holidays/countries/bulgaria.py +9 -10
  44. holidays/countries/burkina_faso.py +14 -5
  45. holidays/countries/burundi.py +17 -12
  46. holidays/countries/cambodia.py +15 -24
  47. holidays/countries/cameroon.py +16 -7
  48. holidays/countries/canada.py +13 -12
  49. holidays/countries/chad.py +15 -6
  50. holidays/countries/chile.py +29 -28
  51. holidays/countries/china.py +39 -38
  52. holidays/countries/colombia.py +15 -20
  53. holidays/countries/congo.py +6 -7
  54. holidays/countries/costa_rica.py +11 -10
  55. holidays/countries/croatia.py +8 -5
  56. holidays/countries/cuba.py +30 -27
  57. holidays/countries/curacao.py +6 -4
  58. holidays/countries/cyprus.py +4 -5
  59. holidays/countries/czechia.py +7 -6
  60. holidays/countries/denmark.py +5 -6
  61. holidays/countries/djibouti.py +11 -3
  62. holidays/countries/dominica.py +18 -16
  63. holidays/countries/dominican_republic.py +6 -4
  64. holidays/countries/ecuador.py +5 -4
  65. holidays/countries/egypt.py +10 -11
  66. holidays/countries/el_salvador.py +6 -5
  67. holidays/countries/estonia.py +3 -1
  68. holidays/countries/eswatini.py +6 -4
  69. holidays/countries/ethiopia.py +26 -11
  70. holidays/countries/fiji.py +183 -0
  71. holidays/countries/finland.py +11 -10
  72. holidays/countries/france.py +6 -9
  73. holidays/countries/gabon.py +17 -8
  74. holidays/countries/georgia.py +7 -7
  75. holidays/countries/germany.py +11 -11
  76. holidays/countries/ghana.py +14 -6
  77. holidays/countries/greece.py +4 -5
  78. holidays/countries/greenland.py +5 -6
  79. holidays/countries/guam.py +12 -6
  80. holidays/countries/guatemala.py +7 -9
  81. holidays/countries/guernsey.py +37 -34
  82. holidays/countries/guinea.py +182 -0
  83. holidays/countries/haiti.py +6 -5
  84. holidays/countries/honduras.py +8 -4
  85. holidays/countries/hongkong.py +49 -60
  86. holidays/countries/hungary.py +26 -23
  87. holidays/countries/iceland.py +5 -4
  88. holidays/countries/india.py +494 -174
  89. holidays/countries/indonesia.py +68 -108
  90. holidays/countries/iran.py +18 -9
  91. holidays/countries/ireland.py +5 -4
  92. holidays/countries/isle_of_man.py +2 -2
  93. holidays/countries/israel.py +4 -5
  94. holidays/countries/italy.py +5 -4
  95. holidays/countries/ivory_coast.py +156 -0
  96. holidays/countries/jamaica.py +6 -4
  97. holidays/countries/japan.py +5 -5
  98. holidays/countries/jersey.py +29 -26
  99. holidays/countries/jordan.py +13 -6
  100. holidays/countries/kazakhstan.py +72 -51
  101. holidays/countries/kenya.py +28 -18
  102. holidays/countries/kuwait.py +14 -7
  103. holidays/countries/kyrgyzstan.py +11 -6
  104. holidays/countries/laos.py +21 -29
  105. holidays/countries/latvia.py +7 -5
  106. holidays/countries/lesotho.py +6 -5
  107. holidays/countries/liechtenstein.py +5 -5
  108. holidays/countries/lithuania.py +4 -5
  109. holidays/countries/luxembourg.py +5 -3
  110. holidays/countries/macau.py +480 -0
  111. holidays/countries/madagascar.py +5 -4
  112. holidays/countries/malawi.py +6 -4
  113. holidays/countries/malaysia.py +30 -18
  114. holidays/countries/maldives.py +14 -7
  115. holidays/countries/malta.py +10 -19
  116. holidays/countries/marshall_islands.py +6 -4
  117. holidays/countries/mauritania.py +13 -6
  118. holidays/countries/mexico.py +8 -7
  119. holidays/countries/moldova.py +6 -4
  120. holidays/countries/monaco.py +6 -4
  121. holidays/countries/montenegro.py +16 -7
  122. holidays/countries/morocco.py +13 -8
  123. holidays/countries/mozambique.py +3 -1
  124. holidays/countries/namibia.py +7 -5
  125. holidays/countries/netherlands.py +6 -6
  126. holidays/countries/new_zealand.py +3 -1
  127. holidays/countries/nicaragua.py +6 -5
  128. holidays/countries/nigeria.py +13 -5
  129. holidays/countries/north_macedonia.py +13 -5
  130. holidays/countries/northern_mariana_islands.py +12 -6
  131. holidays/countries/norway.py +15 -15
  132. holidays/countries/pakistan.py +48 -18
  133. holidays/countries/palau.py +13 -11
  134. holidays/countries/panama.py +9 -8
  135. holidays/countries/papua_new_guinea.py +25 -21
  136. holidays/countries/paraguay.py +10 -9
  137. holidays/countries/peru.py +4 -5
  138. holidays/countries/philippines.py +32 -18
  139. holidays/countries/poland.py +7 -6
  140. holidays/countries/portugal.py +13 -15
  141. holidays/countries/puerto_rico.py +12 -6
  142. holidays/countries/qatar.py +172 -0
  143. holidays/countries/romania.py +6 -4
  144. holidays/countries/russia.py +6 -4
  145. holidays/countries/saint_kitts_and_nevis.py +24 -22
  146. holidays/countries/saint_lucia.py +8 -7
  147. holidays/countries/samoa.py +7 -6
  148. holidays/countries/san_marino.py +4 -3
  149. holidays/countries/saudi_arabia.py +15 -15
  150. holidays/countries/serbia.py +3 -4
  151. holidays/countries/seychelles.py +22 -26
  152. holidays/countries/singapore.py +33 -38
  153. holidays/countries/slovakia.py +6 -5
  154. holidays/countries/slovenia.py +7 -6
  155. holidays/countries/south_africa.py +8 -6
  156. holidays/countries/south_korea.py +25 -32
  157. holidays/countries/spain.py +31 -24
  158. holidays/countries/sri_lanka.py +52 -42
  159. holidays/countries/sweden.py +20 -19
  160. holidays/countries/switzerland.py +6 -5
  161. holidays/countries/taiwan.py +230 -31
  162. holidays/countries/tanzania.py +34 -27
  163. holidays/countries/thailand.py +134 -142
  164. holidays/countries/timor_leste.py +38 -17
  165. holidays/countries/tonga.py +46 -42
  166. holidays/countries/tunisia.py +9 -3
  167. holidays/countries/turkey.py +17 -9
  168. holidays/countries/tuvalu.py +12 -11
  169. holidays/countries/ukraine.py +54 -54
  170. holidays/countries/united_arab_emirates.py +43 -30
  171. holidays/countries/united_kingdom.py +7 -6
  172. holidays/countries/united_states.py +130 -86
  173. holidays/countries/united_states_minor_outlying_islands.py +12 -6
  174. holidays/countries/united_states_virgin_islands.py +12 -6
  175. holidays/countries/uruguay.py +10 -9
  176. holidays/countries/uzbekistan.py +16 -7
  177. holidays/countries/vanuatu.py +7 -5
  178. holidays/countries/vatican_city.py +16 -15
  179. holidays/countries/venezuela.py +11 -14
  180. holidays/countries/vietnam.py +15 -11
  181. holidays/countries/zambia.py +8 -6
  182. holidays/countries/zimbabwe.py +6 -4
  183. holidays/deprecations/v1_incompatibility.py +1 -1
  184. holidays/financial/__init__.py +1 -1
  185. holidays/financial/brasil_bolsa_balcao.py +14 -13
  186. holidays/financial/european_central_bank.py +7 -6
  187. holidays/financial/ice_futures_europe.py +7 -6
  188. holidays/financial/ny_stock_exchange.py +13 -10
  189. holidays/groups/__init__.py +2 -1
  190. holidays/groups/balinese_saka.py +45 -0
  191. holidays/groups/buddhist.py +1 -1
  192. holidays/groups/chinese.py +69 -4
  193. holidays/groups/christian.py +1 -1
  194. holidays/groups/custom.py +1 -1
  195. holidays/groups/eastern.py +1 -1
  196. holidays/groups/hebrew.py +1 -1
  197. holidays/groups/hindu.py +256 -1
  198. holidays/groups/international.py +1 -1
  199. holidays/groups/islamic.py +17 -3
  200. holidays/groups/persian.py +1 -1
  201. holidays/groups/sinhala.py +1 -1
  202. holidays/groups/thai.py +1 -7
  203. holidays/helpers.py +1 -1
  204. holidays/holiday_base.py +410 -273
  205. holidays/ical.py +228 -0
  206. holidays/locale/ar_QA/LC_MESSAGES/QA.mo +0 -0
  207. holidays/locale/de/LC_MESSAGES/PL.mo +0 -0
  208. holidays/locale/en_CI/LC_MESSAGES/CI.mo +0 -0
  209. holidays/locale/en_HK/LC_MESSAGES/HK.mo +0 -0
  210. holidays/locale/en_IN/LC_MESSAGES/IN.mo +0 -0
  211. holidays/locale/en_MO/LC_MESSAGES/MO.mo +0 -0
  212. holidays/locale/en_PK/LC_MESSAGES/PK.mo +0 -0
  213. holidays/locale/en_TL/LC_MESSAGES/TL.mo +0 -0
  214. holidays/locale/en_US/LC_MESSAGES/AR.mo +0 -0
  215. holidays/locale/en_US/LC_MESSAGES/CI.mo +0 -0
  216. holidays/locale/en_US/LC_MESSAGES/GN.mo +0 -0
  217. holidays/locale/en_US/LC_MESSAGES/HK.mo +0 -0
  218. holidays/locale/en_US/LC_MESSAGES/IN.mo +0 -0
  219. holidays/locale/en_US/LC_MESSAGES/MO.mo +0 -0
  220. holidays/locale/en_US/LC_MESSAGES/PK.mo +0 -0
  221. holidays/locale/en_US/LC_MESSAGES/QA.mo +0 -0
  222. holidays/locale/en_US/LC_MESSAGES/TL.mo +0 -0
  223. holidays/locale/en_US/LC_MESSAGES/TW.mo +0 -0
  224. holidays/locale/es/LC_MESSAGES/AR.mo +0 -0
  225. holidays/locale/fr/LC_MESSAGES/CI.mo +0 -0
  226. holidays/locale/fr/LC_MESSAGES/GN.mo +0 -0
  227. holidays/locale/hi/LC_MESSAGES/IN.mo +0 -0
  228. holidays/locale/pt_MO/LC_MESSAGES/MO.mo +0 -0
  229. holidays/locale/pt_TL/LC_MESSAGES/TL.mo +0 -0
  230. holidays/locale/tet/LC_MESSAGES/TL.mo +0 -0
  231. holidays/locale/th/LC_MESSAGES/HK.mo +0 -0
  232. holidays/locale/th/LC_MESSAGES/MO.mo +0 -0
  233. holidays/locale/th/LC_MESSAGES/TL.mo +0 -0
  234. holidays/locale/th/LC_MESSAGES/TW.mo +0 -0
  235. holidays/locale/uk/LC_MESSAGES/AR.mo +0 -0
  236. holidays/locale/ur_PK/LC_MESSAGES/PK.mo +0 -0
  237. holidays/locale/zh_CN/LC_MESSAGES/HK.mo +0 -0
  238. holidays/locale/zh_CN/LC_MESSAGES/MO.mo +0 -0
  239. holidays/locale/zh_CN/LC_MESSAGES/TW.mo +0 -0
  240. holidays/locale/zh_HK/LC_MESSAGES/HK.mo +0 -0
  241. holidays/locale/zh_MO/LC_MESSAGES/MO.mo +0 -0
  242. holidays/locale/zh_TW/LC_MESSAGES/TW.mo +0 -0
  243. holidays/mixins.py +2 -2
  244. holidays/observed_holiday_base.py +5 -2
  245. holidays/registry.py +7 -1
  246. holidays/utils.py +151 -151
  247. holidays/version.py +2 -2
  248. holidays-0.70.dist-info/METADATA +1404 -0
  249. {holidays-0.68.dist-info → holidays-0.70.dist-info}/RECORD +253 -222
  250. {holidays-0.68.dist-info → holidays-0.70.dist-info}/WHEEL +1 -1
  251. holidays-0.68.dist-info/AUTHORS → holidays-0.70.dist-info/licenses/AUTHORS.md +7 -2
  252. {holidays-0.68.dist-info → holidays-0.70.dist-info/licenses}/LICENSE +1 -1
  253. holidays-0.68.dist-info/METADATA +0 -1080
  254. {holidays-0.68.dist-info → holidays-0.70.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,7 @@
4
4
  # specific sets of holidays on the fly. It aims to make determining whether a
5
5
  # specific date is a holiday as fast and flexible as possible.
6
6
  #
7
- # Authors: Vacanza Team and individual contributors (see AUTHORS file)
7
+ # Authors: Vacanza Team and individual contributors (see AUTHORS.md file)
8
8
  # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
9
9
  # ryanss <ryanssdev@icloud.com> (c) 2014-2017
10
10
  # Website: https://github.com/vacanza/holidays
@@ -21,83 +21,93 @@ THAI_CALENDAR = "THAI_CALENDAR"
21
21
 
22
22
 
23
23
  class _ThaiLunisolar:
24
- """
25
- ** Thai Lunar Calendar Holidays only work from 1913 (B.E. 2456/2455) onwards
26
- until 2157 (B.E. 2700) as we only have Thai year-type data for
27
- cross-checking until then.
28
-
29
- So here are the basics of the Thai Lunar Calendar
30
- 3-year types for calendar intercalation:
31
- - Pakatimat (Normal Year):
32
- consist of 12 months, has 354 days.
33
- - Athikawan (Extra-Day Year):
34
- add a day to the 7th month of the year, has 355 days
35
- for the synodic month correction.
36
- - Athikamat (Extra-Month Year):
37
- we have the 8th month twice, has 384 days for the
38
- sidereal year correction.
39
-
40
- Each month either has 30 (Even months) or 29 (Odd months)
41
- - The waxing phase has 15 days until Full Moon and waning
42
- phase 14 (Odd Months)/15 (Even Months/
43
- Month 7 of Athikawan years) days for the New Moon.
44
- - The second "Month 8" for Athikamat years is called
45
- "Month 8.8", with all observed holy days delayed from
46
- the usual calendar by 1 month.
47
-
48
- List of public holidays dependent on the Thai Lunar Calendar:
49
- - Magha Puja/Makha Bucha/Meak Bochea:
50
- 15th Waxing Day (Full Moon) of Month 3
51
- (On Month 4 for Athikamat Years).
52
- KHMER_CALENDAR always fall on Month 3.
53
- - Vesak/Visakha Bucha/Visaka Bochea:
54
- 15th Waxing Day (Full Moon) of Month 6
55
- (On Month 7 for Athikamat Years).
56
- KHMER_CALENDAR always fall on Month 6.
57
- - Thai Royal Ploughing Ceremony/Raeknakhwan:
58
- Based on this, though Court Astrologer picks the
59
- auspicious dates, which sadly don't fall into a
60
- predictable pattern; see its specific section below.
61
- - Cambodian Royal Ploughing Ceremony/Preah Neangkol:
62
- 4th Waning Day of Month 6
63
- (On Month 7 for Athikamat Years).
64
- This defaults to KHMER_CALENDAR (its sole user).
65
- - Asalha Puja/Asarnha Bucha:
66
- 15th Waxing Day (Full Moon) of Month 8
67
- (On Month 8/8 for Athikamat Years).
68
- KHMER_CALENDAR always fall on Month 8.
69
- - Buddhist Lent Day/Wan Khao Phansa:
70
- 1st Waning Day of Month 8
71
- (On Month 8/8 for Athikamat Years).
72
- KHMER_CALENDAR always fall on Month 8.
73
- - Pchum Ben/Prachum Bandar:
74
- 15th Waning Day (New Moon) of Month 10.
75
- - Loy Krathong/Boun That Louang/Bon Om Touk:
76
- 15th Waxing Day (Full Moon) of Month 12.
77
-
78
- Other Buddhist date on Thai Lunar Calendar:
79
- - Buddha's Cremation Day/Atthami Bucha
80
- 8th Waning Day of Month 6
81
- (On Month 7 for Athikamat Years).
82
- KHMER_CALENDAR always fall on Month 6
83
- - End of Buddhist Lent Day/Ok Phansa:
84
- 15th Waxing Day (Full Moon) of Month 11
85
-
86
- The following code is based on Ninenik Narkdee's PHP implementation,
87
- and we're thankful for his work.
88
-
89
- Please avoid touching the Athikawan and Athikamat declaration array
90
- at all costs unless you can find sources for them somewhere for 2057++
91
-
92
- Sources: (Ninenik.com 's wbm) http://tiny.cc/wa_ninenik_thluncal_php
93
- https://www.myhora.com/ปฏิทิน/ปฏิทิน-พ.ศ.2560.aspx
94
-
95
- Usage example:
96
-
97
- >>> from holidays.calendars.thai import _ThaiLunisolar
98
- >>> thls = _ThaiLunisolar()
99
- >>> print(thls.visakha_bucha_date(2010))
100
- 2010-05-28
24
+ """Thai Lunar Calendar Holidays.
25
+
26
+ Works from 1913 (B.E. 2456/2455) onwards until 2157 (B.E. 2700), as we only have
27
+ Thai year-type data for cross-checking through that period.
28
+
29
+ ## The basics of the Thai Lunar Calendar:
30
+
31
+ 3-year types for calendar intercalation:
32
+ * Pakatimat (Normal Year):
33
+ Consists of 12 months, totaling 354 days.
34
+ * Athikawan (Extra-Day Year):
35
+ Adds one extra day to the 7th month, totaling 355 days for synodic month correction.
36
+ * Athikamat (Extra-Month Year):
37
+ Adds one extra 8th month, totaling 384 days for sidereal year correction.
38
+
39
+ Months alternate between 30 (even months) and 29 (odd months) days.
40
+
41
+ The waxing phase (Full Moon) lasts 15 days, while the waning phase (New Moon) lasts
42
+ 14 days for odd months (except Month 7 in Athikawan years), 15 days for even months.
43
+
44
+ The second "Month 8" for Athikamat years is called "Month 8.8"
45
+ (read as "the latter 8th month"), with all observed holidays
46
+ delayed from the usual calendar by 30 days.
47
+
48
+ Implemented Thai Lunar Calendar holiday methods:
49
+ * Magha Puja / Makha Bucha / Meak Bochea:
50
+ 15th Waxing Day (Full Moon) of Month 3 (On Month 4 for Athikamat Years).
51
+ `KHMER_CALENDAR` always falls on Month 3.
52
+
53
+ * Vesak / Visakha Bucha / Visaka Bochea:
54
+ 15th Waxing Day (Full Moon) of Month 6 (On Month 7 for Athikamat Years).
55
+ `KHMER_CALENDAR` always falls on Month 6.
56
+
57
+ * Cambodian Royal Ploughing Ceremony / Preah Neangkol:
58
+ 4th Waning Day of Month 6 (On Month 7 for Athikamat Years).
59
+ Defaults to `KHMER_CALENDAR` (its sole user).
60
+
61
+ * Buddha's Cremation Day / Atthami Bucha:
62
+ 8th Waning Day of Month 6 (On Month 7 for Athikamat Years).
63
+ `KHMER_CALENDAR` always falls on Month 6.
64
+
65
+ * Asalha Puja / Asarnha Bucha:
66
+ 15th Waxing Day (Full Moon) of Month 8 (On Month 8.8 for Athikamat Years).
67
+
68
+ * Buddhist Lent Day / Wan Khao Phansa:
69
+ 1st Waning Day of Month 8 (On Month 8.8 for Athikamat Years).
70
+
71
+ * Boun Haw Khao Padapdin / Boon Khao Padap Din:
72
+ 14th Waning Day (New Moon) of Month 9.
73
+
74
+ * Boun Haw Khao Salark / Boon Khao Sak:
75
+ 15th Waxing Day (Full Moon) of Month 10.
76
+
77
+ * Pchum Ben / Prachum Bandar:
78
+ 15th Waning Day (New Moon) of Month 10.
79
+
80
+ * Ok Boun Suang Huea / Vientiane Boat Racing Festival:
81
+ 1st Waning Day (New Moon) of Month 11.
82
+
83
+ * Loy Krathong / Boun That Louang / Bon Om Touk:
84
+ 15th Waxing Day (Full Moon) of Month 12.
85
+
86
+ Other Thai Lunar Calendar holidays:
87
+ * Thai Royal Ploughing Ceremony / Raeknakhwan:
88
+ Court astrologers choose the auspicious dates based on the Thai Lunar Calendar,
89
+ but these dates do not follow a predictable pattern.
90
+ See the specific section in `thailand.py` for more details.
91
+
92
+ * End of Buddhist Lent Day / Ok Phansa:
93
+ 15th Waxing Day (Full Moon) of Month 11
94
+ (Currently calculated based on Asalha Puja / Asarnha Bucha method).
95
+
96
+ Notes:
97
+ The following code is based on Ninenik Narkdee's PHP implementation,
98
+ and we're thankful for his work.
99
+
100
+ References:
101
+ * <https://www.ninenik.com/แนวทางฟังก์ชั่น_php_อย่างง่ายกับการหาวันข้างขึ้นข้างแรม-1021.html>
102
+ * <https://www.myhora.com/ปฏิทิน/ปฏิทิน-พ.ศ.2560.aspx>
103
+
104
+ Example:
105
+
106
+ >>> from holidays.calendars.thai import _ThaiLunisolar
107
+ >>> thls = _ThaiLunisolar()
108
+ >>> print(thls.visakha_bucha_date(2010))
109
+ 2010-05-28
110
+
101
111
  """
102
112
 
103
113
  # Athikawan (Extra-Day Year) list goes from 1914-2157 C.E.
@@ -263,18 +273,21 @@ class _ThaiLunisolar:
263
273
  self.__calendar = calendar
264
274
 
265
275
  @staticmethod
266
- def __is_khmer_calendar(calendar):
267
- """
268
- Return True if `calendar` is Khmer calendar.
269
- Return False otherwise.
276
+ def __is_khmer_calendar(calendar) -> bool:
277
+ """Check if the given calendar is the Khmer calendar.
278
+
279
+ Args:
280
+ calendar:
281
+ The calendar identifier to check.
282
+
283
+ Returns:
284
+ True if the calendar is `KHMER_CALENDAR`, False otherwise.
270
285
  """
271
286
  return calendar == KHMER_CALENDAR
272
287
 
273
288
  @staticmethod
274
- def __verify_calendar(calendar):
275
- """
276
- Verify calendar type.
277
- """
289
+ def __verify_calendar(calendar) -> None:
290
+ """Verify calendar type."""
278
291
  if calendar not in {KHMER_CALENDAR, THAI_CALENDAR}:
279
292
  raise ValueError(
280
293
  f"Unknown calendar name: {calendar}. Use `KHMER_CALENDAR` or `THAI_CALENDAR`."
@@ -282,16 +295,17 @@ class _ThaiLunisolar:
282
295
 
283
296
  @lru_cache
284
297
  def _get_start_date(self, year: int) -> Optional[date]:
285
- """
286
- Calculate the start date of that particular Thai Lunar Calendar Year.
298
+ """Calculate the start date of that particular Thai Lunar Calendar Year.
299
+
287
300
  This usually falls in November or December of the previous Gregorian
288
301
  year in question. Should the year be outside of working scope
289
302
  (1914-2157: B.E 2457-2700), this will returns None instead.
290
303
 
291
- :param year:
292
- The Gregorian year.
304
+ Args:
305
+ year:
306
+ The Gregorian year.
293
307
 
294
- :return:
308
+ Returns:
295
309
  The start date of Thai Lunar Calendar for a Gregorian year.
296
310
  """
297
311
  if year < _ThaiLunisolar.START_YEAR or year > _ThaiLunisolar.END_YEAR:
@@ -307,32 +321,35 @@ class _ThaiLunisolar:
307
321
  return _timedelta(_ThaiLunisolar.START_DATE, delta_days)
308
322
 
309
323
  def makha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
310
- """
311
- Calculate the estimated Gregorian date of Makha Bucha.
312
- If the Gregorian year input is invalid, this will outputs None instead.
324
+ """Calculate the estimated Gregorian date of Makha Bucha.
313
325
 
314
326
  Also known as "Magha Puja", "Makha Buxha" and "Meak Bochea".
315
327
  This coincides with the 15th Waxing Day of Month 3
316
328
  in Thai Lunar Calendar, or Month 4 in Athikamat years.
317
329
 
318
- KHMER_CALENDAR will always use Month 3 regardless of year type.
330
+ `KHMER_CALENDAR` will always use Month 3 regardless of year type.
319
331
 
320
- To calculate, we use use the following time delta:
321
- - Athikamat: 15th Waxing Day of Month 4
322
- or 29[1] + 30[2] + 29[3] + 15[4] -1 = 102
323
- - Athikawan: 15th Waxing Day of Month 3
324
- or 29[1] + 30[2] + 15[3] -1 = 73
325
- - Pakatimat: 15th Waxing Day of Month 3
326
- or 29[1] + 30[2] + 15[3] -1 = 73
332
+ To calculate, we use the following time delta:
333
+
334
+ * Athikamat:
335
+ 15th Waxing Day of Month 4 or 29[1] + 30[2] + 29[3] + 15[4] -1 = 102
336
+
337
+ * Athikawan:
338
+ 15th Waxing Day of Month 3 or 29[1] + 30[2] + 15[3] -1 = 73
327
339
 
328
- :param year:
329
- The Gregorian year.
340
+ * Pakatimat:
341
+ 15th Waxing Day of Month 3 or 29[1] + 30[2] + 15[3] -1 = 73
330
342
 
331
- :param calendar:
332
- Calendar type, this defaults to THAI_CALENDAR.
343
+ Args:
344
+ year:
345
+ The Gregorian year.
333
346
 
334
- :return:
347
+ calendar:
348
+ Calendar type, this defaults to THAI_CALENDAR.
349
+
350
+ Returns:
335
351
  Estimated Gregorian date of Makha Bucha.
352
+ Returns None if the Gregorian year input is invalid.
336
353
  """
337
354
  calendar = calendar or self.__calendar
338
355
  self.__verify_calendar(calendar)
@@ -352,31 +369,34 @@ class _ThaiLunisolar:
352
369
  )
353
370
 
354
371
  def visakha_bucha_date(self, year: int, calendar=None) -> Optional[date]:
355
- """
356
- Calculate the estimated Gregorian date of Visakha Bucha.
357
- If the Gregorian year input is invalid, this will outputs None instead.
372
+ """Calculate the estimated Gregorian date of Visakha Bucha.
358
373
 
359
374
  Also known as "Vesak" and "Buddha Day". This coincides with
360
375
  the 15th Waxing Day of Month 6 in Thai Lunar Calendar, or Month 7 in Athikamat years.
361
376
 
362
- KHMER_CALENDAR will always use Month 6 regardless of year type.
377
+ `KHMER_CALENDAR` will always use Month 6 regardless of year type.
363
378
 
364
379
  To calculate, we use use the following time delta:
365
- - Athikamat: 15th Waxing Day of Month 7
366
- or 177[1-6] + 15[7] -1 = 191
367
- - Athikawan: 15th Waxing Day of Month 6
368
- or 147[1-5] + 15[6] -1 = 161
369
- - Pakatimat: 15th Waxing Day of Month 6
370
- or 147[1-5] + 15[6] -1 = 161
371
380
 
372
- :param year:
373
- The Gregorian year.
381
+ * Athikamat:
382
+ 15th Waxing Day of Month 7 or 177[1-6] + 15[7] -1 = 191
383
+
384
+ * Athikawan:
385
+ 15th Waxing Day of Month 6 or 147[1-5] + 15[6] -1 = 161
374
386
 
375
- :param calendar:
376
- Calendar type, this defaults to THAI_CALENDAR.
387
+ * Pakatimat:
388
+ 15th Waxing Day of Month 6 or 147[1-5] + 15[6] -1 = 161
377
389
 
378
- :return:
390
+ Args:
391
+ year:
392
+ The Gregorian year.
393
+
394
+ calendar:
395
+ Calendar type, this defaults to THAI_CALENDAR.
396
+
397
+ Returns:
379
398
  Estimated Gregorian date of Visakha Bucha.
399
+ Returns None if the Gregorian year input is invalid.
380
400
  """
381
401
  calendar = calendar or self.__calendar
382
402
  self.__verify_calendar(calendar)
@@ -396,26 +416,29 @@ class _ThaiLunisolar:
396
416
  )
397
417
 
398
418
  def preah_neangkoal_date(self, year: int) -> Optional[date]:
399
- """
400
- Calculate the estimated Gregorian date of Preah Neangkoal.
401
- If the Gregorian year input is invalid, this will outputs None instead.
419
+ """Calculate the estimated Gregorian date of Preah Neangkoal.
402
420
 
403
421
  Also known as "Cambodian Royal Ploughing Ceremony". This always
404
422
  coincides with the 4th Waning Day of Month 6 in Khmer Lunar Calendar.
405
423
 
406
424
  To calculate, we use use the following time delta:
407
- - Athikamat: 15th Waxing Day of Month 6
408
- or 177[1-6] + 19[7] -1 = 165
409
- - Athikawan: 15th Waxing Day of Month 6
410
- or 147[1-5] + 19[6] -1 = 165
411
- - Pakatimat: 15th Waxing Day of Month 6
412
- or 147[1-5] + 19[6] -1 = 165
413
- Or as in simpler terms: "Visakha Bucha" +4
414
-
415
- :param year:
416
- The Gregorian year.
417
-
418
- :return:
425
+
426
+ * Athikamat:
427
+ 4th Waning Day of Month 6 (Khmer Lunar Calendar) or 177[1-5] + 19[6] -1 = 165
428
+
429
+ * Athikawan:
430
+ 4th Waning Day of Month 6 or 147[1-5] + 19[6] -1 = 165
431
+
432
+ * Pakatimat:
433
+ 4th Waning Day of Month 6 or 147[1-5] + 19[6] -1 = 165
434
+
435
+ Or as in simpler terms: "Visakha Bucha" (Khmer Lunar Calendar) +4.
436
+
437
+ Args:
438
+ year:
439
+ The Gregorian year.
440
+
441
+ Returns:
419
442
  Estimated Gregorian date of Preah Neangkoal.
420
443
  """
421
444
  start_date = self._get_start_date(year)
@@ -425,32 +448,36 @@ class _ThaiLunisolar:
425
448
  return _timedelta(start_date, +165)
426
449
 
427
450
  def atthami_bucha_date(self, year: int, calendar=None) -> Optional[date]:
428
- """
429
- Calculate the estimated Gregorian date of Atthami Bucha.
430
- If the Gregorian year input is invalid, this will outputs None instead.
451
+ """Calculate the estimated Gregorian date of Atthami Bucha.
431
452
 
432
453
  Also known as "Buddha's Cremation Day". This coincides with
433
454
  the 8th Waning Day of Month 6 in Thai Lunar Calendar, or Month 7 in Athikamat years.
434
455
 
435
- KHMER_CALENDAR will always use Month 6 regardless of year type.
456
+ `KHMER_CALENDAR` will always use Month 6 regardless of year type.
436
457
 
437
458
  To calculate, we use use the following time delta:
438
- - Athikamat: 8th Waning Day of Month 7
439
- or 177[1-6] + 23[7] -1 = 199
440
- - Athikawan: 8th Waning Day of Month 6
441
- or 147[1-5] + 23[6] -1 = 169
442
- - Pakatimat: 8th Waning Day of Month 6
443
- or 147[1-5] + 23[6] -1 = 169
444
- - Or as in simpler terms: "Visakha Bucha" +8
445
459
 
446
- :param year:
447
- The Gregorian year.
460
+ * Athikamat:
461
+ 8th Waning Day of Month 7 or 177[1-6] + 23[7] -1 = 199
462
+
463
+ * Athikawan:
464
+ 8th Waning Day of Month 6 or 147[1-5] + 23[6] -1 = 169
465
+
466
+ * Pakatimat:
467
+ 8th Waning Day of Month 6 or 147[1-5] + 23[6] -1 = 169
468
+
469
+ Or as in simpler terms: "Visakha Bucha" +8
470
+
471
+ Args:
472
+ year:
473
+ The Gregorian year.
448
474
 
449
- :param calendar:
450
- Calendar type, this defaults to THAI_CALENDAR.
475
+ calendar:
476
+ Calendar type, this defaults to THAI_CALENDAR.
451
477
 
452
- :return:
478
+ Returns:
453
479
  Estimated Gregorian date of Atthami Bucha.
480
+ Returns None if the Gregorian year input is invalid.
454
481
  """
455
482
  calendar = calendar or self.__calendar
456
483
  self.__verify_calendar(calendar)
@@ -470,9 +497,7 @@ class _ThaiLunisolar:
470
497
  )
471
498
 
472
499
  def asarnha_bucha_date(self, year: int) -> Optional[date]:
473
- """
474
- Calculate the estimated Gregorian date of Asarnha Bucha.
475
- If the Gregorian year input is invalid, this will outputs None instead.
500
+ """Calculate the estimated Gregorian date of Asarnha Bucha.
476
501
 
477
502
  Also known as "Asalha Puja". This coincides with
478
503
  the 15th Waxing Day of Month 8 in Thai Lunar Calendar,
@@ -480,19 +505,24 @@ class _ThaiLunisolar:
480
505
 
481
506
  Lao Start of Buddhist Lent start on this day (1-day earlier than Thai and Khmer ones).
482
507
 
483
- To calculate, we use use the following time delta:
484
- - Athikamat: 15th Waxing Day of Month 8/8
485
- or 177[1-6] + 29[7] + 30[8] + 15[8.8] -1 = 250
486
- - Athikawan: 15th Waxing Day of Month 8
487
- or 177[1-6] + 30[7] + 15[8] -1 = 221
488
- - Pakatimat: 15th Waxing Day of Month 8
489
- or 177[1-6] + 29[7] + 15[8] -1 = 220
508
+ To calculate, we use the following time delta:
509
+
510
+ * Athikamat:
511
+ 15th Waxing Day of Month 8/8 or 177[1-6] + 29[7] + 30[8] + 15[8.8] -1 = 250
490
512
 
491
- :param year:
492
- The Gregorian year.
513
+ * Athikawan:
514
+ 15th Waxing Day of Month 8 or 177[1-6] + 30[7] + 15[8] -1 = 221
493
515
 
494
- :return:
516
+ * Pakatimat:
517
+ 15th Waxing Day of Month 8 or 177[1-6] + 29[7] + 15[8] -1 = 220
518
+
519
+ Args:
520
+ year:
521
+ The Gregorian year.
522
+
523
+ Returns:
495
524
  Estimated Gregorian date of Asarnha Bucha.
525
+ Returns None if the Gregorian year input is invalid.
496
526
  """
497
527
  start_date = self._get_start_date(year)
498
528
  if not start_date:
@@ -507,28 +537,32 @@ class _ThaiLunisolar:
507
537
  return _timedelta(start_date, delta_days)
508
538
 
509
539
  def khao_phansa_date(self, year: int) -> Optional[date]:
510
- """
511
- Calculate the estimated Gregorian date of Khao Phansa.
512
- If the Gregorian year input is invalid, this will outputs None instead.
540
+ """Calculate the estimated Gregorian date of Khao Phansa.
513
541
 
514
542
  Also known as "(Start of) Buddhist Lent" and "Start of Vassa".
515
543
  This coincides with the 1st Waning Day of Month 8
516
544
  in Thai Lunar Calendar, or Month 8.8 in Athikamat years.
517
545
 
518
546
  To calculate, we use use the following time delta:
519
- - Athikamat: 1st Waning Day of Month 8.8
520
- or 177[1-6] + 29[7] + 30[8] + 16[8.8] -1 = 251
521
- - Athikawan: 1st Waning Day of Month 8 ]
522
- or 177[1-6] + 30[7] + 16[8] -1 = 222
523
- - Pakatimat: 1st Waning Day of Month 8
524
- or 177[1-6] + 29[7] + 16[8] -1 = 221
525
- - Or as in simpler terms: "Asarnha Bucha" +1
526
-
527
- :param year:
528
- The Gregorian year.
529
-
530
- :return:
547
+
548
+ * Athikamat:
549
+ 1st Waning Day of Month 8.8 or 177[1-6] + 29[7] + 30[8] + 16[8.8] -1 = 251
550
+
551
+ * Athikawan:
552
+ 1st Waning Day of Month 8 or 177[1-6] + 30[7] + 16[8] -1 = 222
553
+
554
+ * Pakatimat:
555
+ 1st Waning Day of Month 8 or 177[1-6] + 29[7] + 16[8] -1 = 221
556
+
557
+ Or as in simpler terms: "Asarnha Bucha" +1
558
+
559
+ Args:
560
+ year:
561
+ The Gregorian year.
562
+
563
+ Returns:
531
564
  Estimated Gregorian date of Khao Phansa.
565
+ Returns None if the Gregorian year input is invalid.
532
566
  """
533
567
  start_date = self._get_start_date(year)
534
568
  if not start_date:
@@ -543,26 +577,29 @@ class _ThaiLunisolar:
543
577
  return _timedelta(start_date, delta_days)
544
578
 
545
579
  def boun_haw_khao_padapdin_date(self, year: int) -> Optional[date]:
546
- """
547
- Calculate the estimated Gregorian date of Boun Haw Khao Padapdin.
548
- If the Gregorian year input is invalid, this will outputs None instead.
580
+ """Calculate the estimated Gregorian date of Boun Haw Khao Padapdin.
549
581
 
550
582
  Also known as "Boon Khao Padap Din".
551
583
  This coincides with the 14th Waning Day of Month 9 in Thai Lunar Calendar.
552
584
 
553
- To calculate, we use use the following time delta:
554
- - Athikamat: 14th Waning Day of Month 9
555
- or 236[1-8] + 30[8.8] + 29[9] -1 = 294
556
- - Athikawan: 14th Waning Day of Month 9
557
- or 236[1-8] + 1[7] + 29[9] -1 = 265
558
- - Pakatimat: 14th Waning Day of Month 9
559
- or 236[1-8] + 29[9] -1 = 264
585
+ To calculate, we use use the following time delta:
586
+
587
+ * Athikamat:
588
+ 14th Waning Day of Month 9 or 236[1-8] + 30[8.8] + 29[9] -1 = 294
589
+
590
+ * Athikawan:
591
+ 14th Waning Day of Month 9 or 236[1-8] + 1[7] + 29[9] -1 = 265
592
+
593
+ * Pakatimat:
594
+ 14th Waning Day of Month 9 or 236[1-8] + 29[9] -1 = 264
560
595
 
561
- :param year:
562
- The Gregorian year.
596
+ Args:
597
+ year:
598
+ The Gregorian year.
563
599
 
564
- :return:
600
+ Returns:
565
601
  Estimated Gregorian date of Boun Haw Khao Padapdin.
602
+ Returns None if the Gregorian year input is invalid.
566
603
  """
567
604
  start_date = self._get_start_date(year)
568
605
  if not start_date:
@@ -577,26 +614,29 @@ class _ThaiLunisolar:
577
614
  return _timedelta(start_date, delta_days)
578
615
 
579
616
  def boun_haw_khao_salark_date(self, year: int) -> Optional[date]:
580
- """
581
- Calculate the estimated Gregorian date of Boun Haw Khao Salark.
582
- If the Gregorian year input is invalid, this will outputs None instead.
617
+ """Calculate the estimated Gregorian date of Boun Haw Khao Salark.
583
618
 
584
619
  Also known as "Boon Khao Sak".
585
620
  This coincides with the 15th Waxing Day of Month 10 in Thai Lunar Calendar.
586
621
 
587
- To calculate, we use use the following time delta:
588
- - Athikamat: 15th Waxing Day of Month 10
589
- or 265[1-9] + 30[8.8] + 15[10] -1 = 309
590
- - Athikawan: 15th Waxing Day of Month 10
591
- or 265[1-9] + 1[7] + 15[10] -1 = 280
592
- - Pakatimat: 15th Waxing Day of Month 10
593
- or 265[1-9] + 15[10] -1 = 279
622
+ To calculate, we use use the following time delta:
594
623
 
595
- :param year:
596
- The Gregorian year.
624
+ * Athikamat:
625
+ 15th Waxing Day of Month 10 or 265[1-9] + 30[8.8] + 15[10] -1 = 309
597
626
 
598
- :return:
599
- Estimated Gregorian date of Pchum Ben.
627
+ * Athikawan:
628
+ 15th Waxing Day of Month 10 or 265[1-9] + 1[7] + 15[10] -1 = 280
629
+
630
+ * Pakatimat:
631
+ 15th Waxing Day of Month 10 or 265[1-9] + 15[10] -1 = 279
632
+
633
+ Args:
634
+ year:
635
+ The Gregorian year.
636
+
637
+ Returns:
638
+ Estimated Gregorian date of Boun Haw Khao Salark.
639
+ Returns None if the Gregorian year input is invalid.
600
640
  """
601
641
  start_date = self._get_start_date(year)
602
642
  if not start_date:
@@ -611,26 +651,29 @@ class _ThaiLunisolar:
611
651
  return _timedelta(start_date, delta_days)
612
652
 
613
653
  def pchum_ben_date(self, year: int) -> Optional[date]:
614
- """
615
- Calculate the estimated Gregorian date of Pchum Ben.
616
- If the Gregorian year input is invalid, this will outputs None instead.
654
+ """Calculate the estimated Gregorian date of Pchum Ben.
617
655
 
618
656
  Also known as "Prachum Bandar".
619
657
  This coincides with the 15th Waning Day of Month 10 in Thai Lunar Calendar.
620
658
 
621
- To calculate, we use use the following time delta:
622
- - Athikamat: 15th Waning Day of Month 10
623
- or 265[1-9] + 30[8.8] + 30[10] -1 = 324
624
- - Athikawan: 15th Waning Day of Month 10
625
- or 265[1-9] + 1[7] + 30[10] -1 = 295
626
- - Pakatimat: 15th Waning Day of Month 10
627
- or 265[1-9] + 30[10] -1 = 294
659
+ To calculate, we use use the following time delta:
660
+
661
+ * Athikamat:
662
+ 15th Waning Day of Month 10 or 265[1-9] + 30[8.8] + 30[10] -1 = 324
628
663
 
629
- :param year:
630
- The Gregorian year.
664
+ * Athikawan:
665
+ 15th Waning Day of Month 10 or 265[1-9] + 1[7] + 30[10] -1 = 295
631
666
 
632
- :return:
667
+ * Pakatimat:
668
+ 15th Waning Day of Month 10 or 265[1-9] + 30[10] -1 = 294
669
+
670
+ Args:
671
+ year:
672
+ The Gregorian year.
673
+
674
+ Returns:
633
675
  Estimated Gregorian date of Pchum Ben.
676
+ Returns None if the Gregorian year input is invalid.
634
677
  """
635
678
  start_date = self._get_start_date(year)
636
679
  if not start_date:
@@ -645,26 +688,29 @@ class _ThaiLunisolar:
645
688
  return _timedelta(start_date, delta_days)
646
689
 
647
690
  def ok_phansa_date(self, year: int) -> Optional[date]:
648
- """
649
- Calculate the estimated Gregorian date of Ok Phansa.
650
- If the Gregorian year input is invalid, this will outputs None instead.
691
+ """Calculate the estimated Gregorian date of Ok Phansa.
651
692
 
652
693
  Also known as "End of Buddhist Lent" and "End of Vassa".
653
694
  This coincides with the 15th Waxing Day of Month 11 in Thai Lunar Calendar.
654
695
 
655
696
  To calculate, we use use the following time delta:
656
- - Athikamat: 15th Waxing Day of Month 11
657
- or 295[1-10] + 30[8.8] + 15[11] -1 = 339
658
- - Athikawan: 15th Waxing Day of Month 11
659
- or 295[1-10] + 1[7] + 15[11] -1 = 310
660
- - Pakatimat: 15th Waxing Day of Month 11
661
- or 295[1-10] + 15[11] -1 = 309
662
697
 
663
- :param year:
664
- The Gregorian year.
698
+ * Athikamat:
699
+ 15th Waxing Day of Month 11 or 295[1-10] + 30[8.8] + 15[11] -1 = 339
665
700
 
666
- :return:
701
+ * Athikawan:
702
+ 15th Waxing Day of Month 11 or 295[1-10] + 1[7] + 15[11] -1 = 310
703
+
704
+ * Pakatimat:
705
+ 15th Waxing Day of Month 11 or 295[1-10] + 15[11] -1 = 309
706
+
707
+ Args:
708
+ year:
709
+ The Gregorian year.
710
+
711
+ Returns:
667
712
  Estimated Gregorian date of Ok Phansa.
713
+ Returns None if the Gregorian year input is invalid.
668
714
  """
669
715
  start_date = self._get_start_date(year)
670
716
  if not start_date:
@@ -679,26 +725,29 @@ class _ThaiLunisolar:
679
725
  return _timedelta(start_date, delta_days)
680
726
 
681
727
  def boun_suang_heua_date(self, year: int) -> Optional[date]:
682
- """
683
- Calculate the estimated Gregorian date of Ok Boun Suang Huea.
684
- If the Gregorian year input is invalid, this will outputs None instead.
728
+ """Calculate the estimated Gregorian date of Ok Boun Suang Huea.
685
729
 
686
730
  Boun Suang Huea Nakhone Luang Prabang, also known as "Vientiane Boat Racing Festival".
687
731
  This coincides with the 1st Waning Day of Month 11 in Thai Lunar Calendar.
688
732
 
689
733
  To calculate, we use use the following time delta:
690
- - Athikamat: 1st Waning Day of Month 11
691
- or 295[1-10] + 30[8.8] + 16[11] -1 = 340
692
- - Athikawan: 1st Waning Day of Month 11
693
- or 295[1-10] + 1[7] + 16[11] -1 = 311
694
- - Pakatimat: 1st Waning Day of Month 11
695
- or 295[1-10] + 16[11] -1 = 310
696
734
 
697
- :param year:
698
- The Gregorian year.
735
+ * Athikamat:
736
+ 1st Waning Day of Month 11 or 295[1-10] + 30[8.8] + 16[11] -1 = 340
737
+
738
+ * Athikawan:
739
+ 1st Waning Day of Month 11 or 295[1-10] + 1[7] + 16[11] -1 = 311
740
+
741
+ * Pakatimat:
742
+ 1st Waning Day of Month 11 or 295[1-10] + 16[11] -1 = 310
699
743
 
700
- :return:
744
+ Args:
745
+ year:
746
+ The Gregorian year.
747
+
748
+ Returns:
701
749
  Estimated Gregorian date of Boun Suang Huea.
750
+ Returns None if the Gregorian year input is invalid.
702
751
  """
703
752
  start_date = self._get_start_date(year)
704
753
  if not start_date:
@@ -713,26 +762,29 @@ class _ThaiLunisolar:
713
762
  return _timedelta(start_date, delta_days)
714
763
 
715
764
  def loy_krathong_date(self, year: int) -> Optional[date]:
716
- """
717
- Calculate the estimated Gregorian date of Loy Krathong.
718
- If the Gregorian year input is invalid, this will outputs None instead.
765
+ """Calculate the estimated Gregorian date of Loy Krathong.
719
766
 
720
767
  Also known as "Boun That Louang" and "Bon Om Touk".
721
768
  This coincides with the 15th Waxing Day of Month 12 in Thai Lunar Calendar.
722
769
 
723
770
  To calculate, we use use the following time delta:
724
- - Athikamat: 15th Waxing Day of Month 12
725
- or 324[1-11] + 30[8.8] + 15[11] -1 = 368
726
- - Athikawan: 15th Waxing Day of Month 12
727
- or 324[1-11] + 1[7] + 15[11] -1 = 339
728
- - Pakatimat: 15th Waxing Day of Month 12
729
- or 324[1-11] + 15[11] -1 = 338
730
771
 
731
- :param year:
732
- The Gregorian year.
772
+ * Athikamat:
773
+ 15th Waxing Day of Month 12 or 324[1-11] + 30[8.8] + 15[11] -1 = 368
774
+
775
+ * Athikawan:
776
+ 15th Waxing Day of Month 12 or 324[1-11] + 1[7] + 15[11] -1 = 339
777
+
778
+ * Pakatimat:
779
+ 15th Waxing Day of Month 12 or 324[1-11] + 15[11] -1 = 338
780
+
781
+ Args:
782
+ year:
783
+ The Gregorian year.
733
784
 
734
- :return:
785
+ Returns:
735
786
  Estimated Gregorian date of Loy Krathong.
787
+ Returns None if the Gregorian year input is invalid.
736
788
  """
737
789
  start_date = self._get_start_date(year)
738
790
  if not start_date: