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
holidays/utils.py CHANGED
@@ -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
@@ -41,47 +41,48 @@ def country_holidays(
41
41
  categories: Optional[CategoryArg] = None,
42
42
  ) -> HolidayBase:
43
43
  """
44
- Returns a new dictionary-like :py:class:`HolidayBase` object for the public
44
+ Returns a new dictionary-like `HolidayBase` object for the public
45
45
  holidays of the country matching **country** and other keyword arguments.
46
46
 
47
- :param country:
48
- An ISO 3166-1 Alpha-2 country code.
47
+ Args:
48
+ country:
49
+ An ISO 3166-1 Alpha-2 country code.
49
50
 
50
- :param subdiv:
51
- The subdivision (e.g. state or province) as a ISO 3166-2 code
52
- or its alias; not implemented for all countries (see documentation).
51
+ subdiv:
52
+ The subdivision (e.g. state or province) as a ISO 3166-2 code
53
+ or its alias; not implemented for all countries (see documentation).
53
54
 
54
- :param years:
55
- The year(s) to pre-calculate public holidays for at instantiation.
55
+ years:
56
+ The year(s) to pre-calculate public holidays for at instantiation.
56
57
 
57
- :param expand:
58
- Whether the entire year is calculated when one date from that year
59
- is requested.
58
+ expand:
59
+ Whether the entire year is calculated when one date from that year
60
+ is requested.
60
61
 
61
- :param observed:
62
- Whether to include the dates of when public holiday are observed
63
- (e.g. a holiday falling on a Sunday being observed the following
64
- Monday). False may not work for all countries.
62
+ observed:
63
+ Whether to include the dates of when public holiday are observed
64
+ (e.g. a holiday falling on a Sunday being observed the following
65
+ Monday). False may not work for all countries.
65
66
 
66
- :param prov:
67
- *deprecated* use subdiv instead.
67
+ prov:
68
+ *deprecated* use `subdiv` instead.
68
69
 
69
- :param state:
70
- *deprecated* use subdiv instead.
70
+ state:
71
+ *deprecated* use `subdiv` instead.
71
72
 
72
- :param language:
73
- The language which the returned holiday names will be translated
74
- into. It must be an ISO 639-1 (2-letter) language code. If the
75
- language translation is not supported the original holiday names
76
- will be used.
73
+ language:
74
+ The language which the returned holiday names will be translated
75
+ into. It must be an ISO 639-1 (2-letter) language code. If the
76
+ language translation is not supported the original holiday names
77
+ will be used.
77
78
 
78
- :param categories:
79
- Requested holiday categories.
79
+ categories:
80
+ Requested holiday categories.
80
81
 
81
- :return:
82
- A :py:class:`HolidayBase` object matching the **country**.
82
+ Returns:
83
+ A `HolidayBase` object matching the **country**.
83
84
 
84
- The key of the :class:`dict`-like :class:`HolidayBase` object is the
85
+ The key of the `dict`-like `HolidayBase` object is the
85
86
  `date` of the holiday, and the value is the name of the holiday itself.
86
87
  Dates where a key is not present are not public holidays (or, if
87
88
  **observed** is False, days when a public holiday is observed).
@@ -89,12 +90,12 @@ def country_holidays(
89
90
  When passing the `date` as a key, the `date` can be expressed in one of the
90
91
  following types:
91
92
 
92
- * :class:`datetime.date`,
93
- * :class:`datetime.datetime`,
94
- * a :class:`str` of any format recognized by :func:`dateutil.parser.parse`,
95
- * or a :class:`float` or :class:`int` representing a POSIX timestamp.
93
+ * `datetime.date`,
94
+ * `datetime.datetime`,
95
+ * a `str` of any format recognized by `dateutil.parser.parse()`,
96
+ * or a `float` or `int` representing a POSIX timestamp.
96
97
 
97
- The key is always returned as a :class:`datetime.date` object.
98
+ The key is always returned as a `datetime.date` object.
98
99
 
99
100
  To maximize speed, the list of public holidays is built on the fly as
100
101
  needed, one calendar year at a time. When the object is instantiated
@@ -107,70 +108,70 @@ def country_holidays(
107
108
 
108
109
  Example usage:
109
110
 
110
- >>> from holidays import country_holidays
111
- >>> us_holidays = country_holidays('US')
112
- # For a specific subdivision (e.g. state or province):
113
- >>> calif_holidays = country_holidays('US', subdiv='CA')
111
+ >>> from holidays import country_holidays
112
+ >>> us_holidays = country_holidays('US')
113
+ # For a specific subdivision (e.g. state or province):
114
+ >>> calif_holidays = country_holidays('US', subdiv='CA')
114
115
 
115
116
  The below will cause 2015 holidays to be calculated on the fly:
116
117
 
117
- >>> from datetime import date
118
- >>> assert date(2015, 1, 1) in us_holidays
118
+ >>> from datetime import date
119
+ >>> assert date(2015, 1, 1) in us_holidays
119
120
 
120
121
  This will be faster because 2015 holidays are already calculated:
121
122
 
122
- >>> assert date(2015, 1, 2) not in us_holidays
123
+ >>> assert date(2015, 1, 2) not in us_holidays
123
124
 
124
- The :class:`HolidayBase` class also recognizes strings of many formats
125
+ The `HolidayBase` class also recognizes strings of many formats
125
126
  and numbers representing a POSIX timestamp:
126
127
 
127
- >>> assert '2014-01-01' in us_holidays
128
- >>> assert '1/1/2014' in us_holidays
129
- >>> assert 1388597445 in us_holidays
128
+ >>> assert '2014-01-01' in us_holidays
129
+ >>> assert '1/1/2014' in us_holidays
130
+ >>> assert 1388597445 in us_holidays
130
131
 
131
132
  Show the holiday's name:
132
133
 
133
- >>> us_holidays.get('2014-01-01')
134
- "New Year's Day"
134
+ >>> us_holidays.get('2014-01-01')
135
+ "New Year's Day"
135
136
 
136
137
  Check a range:
137
138
 
138
- >>> us_holidays['2014-01-01': '2014-01-03']
139
- [datetime.date(2014, 1, 1)]
139
+ >>> us_holidays['2014-01-01': '2014-01-03']
140
+ [datetime.date(2014, 1, 1)]
140
141
 
141
142
  List all 2020 holidays:
142
143
 
143
- >>> us_holidays = country_holidays('US', years=2020)
144
- >>> for day in us_holidays.items():
145
- ... print(day)
146
- (datetime.date(2020, 1, 1), "New Year's Day")
147
- (datetime.date(2020, 1, 20), 'Martin Luther King Jr. Day')
148
- (datetime.date(2020, 2, 17), "Washington's Birthday")
149
- (datetime.date(2020, 5, 25), 'Memorial Day')
150
- (datetime.date(2020, 7, 4), 'Independence Day')
151
- (datetime.date(2020, 7, 3), 'Independence Day (observed)')
152
- (datetime.date(2020, 9, 7), 'Labor Day')
153
- (datetime.date(2020, 10, 12), 'Columbus Day')
154
- (datetime.date(2020, 11, 11), 'Veterans Day')
155
- (datetime.date(2020, 11, 26), 'Thanksgiving')
156
- (datetime.date(2020, 12, 25), 'Christmas Day')
144
+ >>> us_holidays = country_holidays('US', years=2020)
145
+ >>> for day in sorted(us_holidays.items()):
146
+ ... print(day)
147
+ (datetime.date(2020, 1, 1), "New Year's Day")
148
+ (datetime.date(2020, 1, 20), 'Martin Luther King Jr. Day')
149
+ (datetime.date(2020, 2, 17), "Washington's Birthday")
150
+ (datetime.date(2020, 5, 25), 'Memorial Day')
151
+ (datetime.date(2020, 7, 3), 'Independence Day (observed)')
152
+ (datetime.date(2020, 7, 4), 'Independence Day')
153
+ (datetime.date(2020, 9, 7), 'Labor Day')
154
+ (datetime.date(2020, 10, 12), 'Columbus Day')
155
+ (datetime.date(2020, 11, 11), 'Veterans Day')
156
+ (datetime.date(2020, 11, 26), 'Thanksgiving Day')
157
+ (datetime.date(2020, 12, 25), 'Christmas Day')
157
158
 
158
159
  Some holidays are only present in parts of a country:
159
160
 
160
- >>> us_pr_holidays = country_holidays('US', subdiv='PR')
161
- >>> assert '2018-01-06' not in us_holidays
162
- >>> assert '2018-01-06' in us_pr_holidays
161
+ >>> us_pr_holidays = country_holidays('US', subdiv='PR')
162
+ >>> assert '2018-01-06' not in us_holidays
163
+ >>> assert '2018-01-06' in us_pr_holidays
163
164
 
164
165
  Append custom holiday dates by passing one of:
165
166
 
166
- * a :class:`dict` with date/name key/value pairs (e.g.
167
- ``{'2010-07-10': 'My birthday!'}``),
168
- * a list of dates (as a :class:`datetime.date`, :class:`datetime.datetime`,
169
- :class:`str`, :class:`int`, or :class:`float`); ``'Holiday'`` will be
170
- used as a description,
171
- * or a single date item (of one of the types above); ``'Holiday'`` will be
167
+ * a `dict` with date/name key/value pairs (e.g.
168
+ `{'2010-07-10': 'My birthday!'}`),
169
+ * a list of dates (as a `datetime.date`, `datetime.datetime`,
170
+ `str`, `int`, or `float`); "Holiday" will be used as a description,
171
+ * or a single date item (of one of the types above); "Holiday" will be
172
172
  used as a description:
173
173
 
174
+ ```python
174
175
  >>> custom_holidays = country_holidays('US', years=2015)
175
176
  >>> custom_holidays.update({'2015-01-01': "New Year's Day"})
176
177
  >>> custom_holidays.update(['2015-07-01', '07/04/2015'])
@@ -178,9 +179,10 @@ def country_holidays(
178
179
  >>> assert date(2015, 1, 1) in custom_holidays
179
180
  >>> assert date(2015, 1, 2) not in custom_holidays
180
181
  >>> assert '12/25/2015' in custom_holidays
182
+ ```
181
183
 
182
184
  For more complex logic, like 4th Monday of January, you can inherit the
183
- :class:`HolidayBase` class and define your own :meth:`_populate` method.
185
+ `HolidayBase` class and define your own `_populate` method.
184
186
  See documentation for examples.
185
187
  """
186
188
  import holidays
@@ -213,40 +215,41 @@ def financial_holidays(
213
215
  holidays of the financial market matching **market** and other keyword
214
216
  arguments.
215
217
 
216
- :param market:
217
- An ISO 3166-1 Alpha-2 market code.
218
+ Args:
219
+ market:
220
+ An ISO 3166-1 Alpha-2 market code.
218
221
 
219
- :param subdiv:
220
- Currently not implemented for markets (see documentation).
222
+ subdiv:
223
+ Currently not implemented for markets (see documentation).
221
224
 
222
- :param years:
223
- The year(s) to pre-calculate public holidays for at instantiation.
225
+ years:
226
+ The year(s) to pre-calculate public holidays for at instantiation.
224
227
 
225
- :param expand:
226
- Whether the entire year is calculated when one date from that year
227
- is requested.
228
+ expand:
229
+ Whether the entire year is calculated when one date from that year
230
+ is requested.
228
231
 
229
- :param observed:
230
- Whether to include the dates of when public holiday are observed
231
- (e.g. a holiday falling on a Sunday being observed the following
232
- Monday). False may not work for all countries.
232
+ observed:
233
+ Whether to include the dates of when public holiday are observed
234
+ (e.g. a holiday falling on a Sunday being observed the following
235
+ Monday). False may not work for all countries.
233
236
 
234
- :param language:
235
- The language which the returned holiday names will be translated
236
- into. It must be an ISO 639-1 (2-letter) language code. If the
237
- language translation is not supported the original holiday names
238
- will be used.
237
+ language:
238
+ The language which the returned holiday names will be translated
239
+ into. It must be an ISO 639-1 (2-letter) language code. If the
240
+ language translation is not supported the original holiday names
241
+ will be used.
239
242
 
240
- :return:
241
- A :py:class:`HolidayBase` object matching the **market**.
243
+ Returns:
244
+ A `HolidayBase` object matching the **market**.
242
245
 
243
246
  Example usage:
244
247
 
245
- >>> from holidays import financial_holidays
246
- >>> nyse_holidays = financial_holidays('NYSE')
248
+ >>> from holidays import financial_holidays
249
+ >>> nyse_holidays = financial_holidays('XNYS')
247
250
 
248
- See :py:func:`country_holidays` documentation for further details and
249
- examples.
251
+ See [country_holidays()][holidays.utils.country_holidays] documentation for further
252
+ details and examples.
250
253
  """
251
254
  import holidays
252
255
 
@@ -268,9 +271,8 @@ def CountryHoliday( # noqa: N802
268
271
  state: Optional[str] = None,
269
272
  ) -> HolidayBase:
270
273
  """
271
- Deprecated name for :py:func:`country_holidays`.
272
-
273
- :meta private:
274
+ Note:
275
+ Deprecated name for `country_holidays()`.
274
276
  """
275
277
 
276
278
  warnings.warn(
@@ -280,16 +282,16 @@ def CountryHoliday( # noqa: N802
280
282
 
281
283
 
282
284
  def _list_localized_entities(entity_codes: Iterable[str]) -> dict[str, list[str]]:
283
- """
284
- Get all localized entities and languages they support.
285
+ """Get all localized entities and languages they support.
285
286
 
286
- :param entity_codes:
287
- A list of entity codes.
287
+ Args:
288
+ entity_codes:
289
+ A list of entity codes.
288
290
 
289
- :return:
290
- A dictionary where key is an entity code and
291
- value is a list of supported languages (either ISO 639-1 or a
292
- combination of ISO 639-1 and ISO 3166-1 codes joined with "_").
291
+ Returns:
292
+ A dictionary where key is an entity code and value is a list of supported
293
+ languages (either ISO 639-1 or a combination of ISO 639-1 and ISO 3166-1 codes joined
294
+ with "_").
293
295
  """
294
296
  import holidays
295
297
 
@@ -304,48 +306,46 @@ def _list_localized_entities(entity_codes: Iterable[str]) -> dict[str, list[str]
304
306
 
305
307
 
306
308
  @lru_cache
307
- def list_localized_countries(include_aliases=True) -> dict[str, list[str]]:
308
- """
309
- Get all localized countries and languages they support.
309
+ def list_localized_countries(include_aliases: bool = True) -> dict[str, list[str]]:
310
+ """Get all localized countries and languages they support.
310
311
 
311
- :param include_aliases:
312
- Whether to include entity aliases (e.g. UK for GB).
312
+ Args:
313
+ include_aliases:
314
+ Whether to include entity aliases (e.g. UK for GB).
313
315
 
314
- :return:
315
- A dictionary where key is an ISO 3166-1 alpha-2 country code and
316
- value is a list of supported languages (either ISO 639-1 or a
317
- combination of ISO 639-1 and ISO 3166-1 codes joined with "_").
316
+ Returns:
317
+ A dictionary where key is an ISO 3166-1 alpha-2 country code and value is a
318
+ list of supported languages (either ISO 639-1 or a combination of ISO 639-1
319
+ and ISO 3166-1 codes joined with "_").
318
320
  """
319
-
320
321
  return _list_localized_entities(EntityLoader.get_country_codes(include_aliases))
321
322
 
322
323
 
323
324
  @lru_cache
324
- def list_localized_financial(include_aliases=True) -> dict[str, list[str]]:
325
- """
326
- Get all localized financial markets and languages they support.
325
+ def list_localized_financial(include_aliases: bool = True) -> dict[str, list[str]]:
326
+ """Get all localized financial markets and languages they support.
327
327
 
328
- :param include_aliases:
329
- Whether to include entity aliases(e.g. TAR for ECB, XNYS for NYSE).
328
+ Args:
329
+ include_aliases:
330
+ Whether to include entity aliases (e.g. TAR for ECB, XNYS for NYSE).
330
331
 
331
- :return:
332
- A dictionary where key is a market code and value is a list of
333
- supported subdivision codes.
332
+ Returns:
333
+ A dictionary where key is a market code and value is a list of supported
334
+ subdivision codes.
334
335
  """
335
-
336
336
  return _list_localized_entities(EntityLoader.get_financial_codes(include_aliases))
337
337
 
338
338
 
339
339
  def _list_supported_entities(entity_codes: Iterable[str]) -> dict[str, list[str]]:
340
- """
341
- Get all supported entities and their subdivisions.
340
+ """Get all supported entities and their subdivisions.
342
341
 
343
- :param entity_codes:
344
- A list of entity codes.
342
+ Args:
343
+ entity_codes:
344
+ A list of entity codes.
345
345
 
346
- :return:
347
- A dictionary where key is an entity code and value is a list
348
- of supported subdivision codes.
346
+ Returns:
347
+ A dictionary where key is an entity code and value is a list of supported
348
+ subdivision codes.
349
349
  """
350
350
  import holidays
351
351
 
@@ -356,30 +356,30 @@ def _list_supported_entities(entity_codes: Iterable[str]) -> dict[str, list[str]
356
356
 
357
357
 
358
358
  @lru_cache
359
- def list_supported_countries(include_aliases=True) -> dict[str, list[str]]:
360
- """
361
- Get all supported countries and their subdivisions.
359
+ def list_supported_countries(include_aliases: bool = True) -> dict[str, list[str]]:
360
+ """Get all supported countries and their subdivisions.
362
361
 
363
- :param include_aliases:
364
- Whether to include entity aliases (e.g. UK for GB).
362
+ Args:
363
+ include_aliases:
364
+ Whether to include entity aliases (e.g. UK for GB).
365
365
 
366
- :return:
367
- A dictionary where key is an ISO 3166-1 alpha-2 country code and
368
- value is a list of supported subdivision codes.
366
+ Returns:
367
+ A dictionary where key is an ISO 3166-1 alpha-2 country code and value
368
+ is a list of supported subdivision codes.
369
369
  """
370
370
  return _list_supported_entities(EntityLoader.get_country_codes(include_aliases))
371
371
 
372
372
 
373
373
  @lru_cache
374
- def list_supported_financial(include_aliases=True) -> dict[str, list[str]]:
375
- """
376
- Get all supported financial markets and their subdivisions.
374
+ def list_supported_financial(include_aliases: bool = True) -> dict[str, list[str]]:
375
+ """Get all supported financial markets and their subdivisions.
377
376
 
378
- :param include_aliases:
379
- Whether to include entity aliases(e.g. TAR for ECB, XNYS for NYSE).
377
+ Args:
378
+ include_aliases:
379
+ Whether to include entity aliases (e.g. TAR for ECB, XNYS for NYSE).
380
380
 
381
- :return:
382
- A dictionary where key is a market code and value is a list of
383
- supported subdivision codes.
381
+ Returns:
382
+ A dictionary where key is a market code and value is a list of supported
383
+ subdivision codes.
384
384
  """
385
385
  return _list_supported_entities(EntityLoader.get_financial_codes(include_aliases))
holidays/version.py CHANGED
@@ -4,10 +4,10 @@
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
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- __version__ = "0.68"
13
+ __version__ = "0.70"