holidays 0.48__py3-none-any.whl → 0.50__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 (71) hide show
  1. holidays/__init__.py +12 -1
  2. holidays/calendars/gregorian.py +22 -7
  3. holidays/calendars/persian.py +3 -2
  4. holidays/calendars/thai.py +24 -20
  5. holidays/countries/__init__.py +1 -0
  6. holidays/countries/angola.py +2 -2
  7. holidays/countries/aruba.py +2 -3
  8. holidays/countries/botswana.py +19 -9
  9. holidays/countries/cambodia.py +7 -8
  10. holidays/countries/canada.py +2 -1
  11. holidays/countries/chile.py +14 -11
  12. holidays/countries/curacao.py +3 -4
  13. holidays/countries/finland.py +2 -2
  14. holidays/countries/georgia.py +17 -1
  15. holidays/countries/greenland.py +96 -0
  16. holidays/countries/hongkong.py +398 -133
  17. holidays/countries/isle_of_man.py +3 -8
  18. holidays/countries/israel.py +13 -13
  19. holidays/countries/italy.py +163 -133
  20. holidays/countries/japan.py +52 -33
  21. holidays/countries/jersey.py +11 -9
  22. holidays/countries/laos.py +7 -23
  23. holidays/countries/madagascar.py +2 -3
  24. holidays/countries/malaysia.py +545 -235
  25. holidays/countries/monaco.py +4 -6
  26. holidays/countries/netherlands.py +2 -3
  27. holidays/countries/new_zealand.py +5 -5
  28. holidays/countries/russia.py +18 -4
  29. holidays/countries/saudi_arabia.py +2 -3
  30. holidays/countries/south_korea.py +17 -4
  31. holidays/countries/sweden.py +2 -3
  32. holidays/countries/switzerland.py +18 -17
  33. holidays/deprecation.py +33 -0
  34. holidays/financial/__init__.py +1 -0
  35. holidays/financial/ice_futures_europe.py +47 -0
  36. holidays/financial/ny_stock_exchange.py +17 -4
  37. holidays/groups/chinese.py +2 -3
  38. holidays/groups/christian.py +18 -19
  39. holidays/groups/islamic.py +2 -2
  40. holidays/groups/persian.py +2 -2
  41. holidays/helpers.py +9 -3
  42. holidays/holiday_base.py +18 -15
  43. holidays/locale/da/LC_MESSAGES/GL.mo +0 -0
  44. holidays/locale/da/LC_MESSAGES/GL.po +91 -0
  45. holidays/locale/en_US/LC_MESSAGES/GE.mo +0 -0
  46. holidays/locale/en_US/LC_MESSAGES/GE.po +8 -4
  47. holidays/locale/en_US/LC_MESSAGES/GL.mo +0 -0
  48. holidays/locale/en_US/LC_MESSAGES/GL.po +92 -0
  49. holidays/locale/en_US/LC_MESSAGES/MY.mo +0 -0
  50. holidays/locale/en_US/LC_MESSAGES/MY.po +250 -0
  51. holidays/locale/en_US/LC_MESSAGES/RU.mo +0 -0
  52. holidays/locale/en_US/LC_MESSAGES/RU.po +11 -2
  53. holidays/locale/ka/LC_MESSAGES/GE.mo +0 -0
  54. holidays/locale/ka/LC_MESSAGES/GE.po +8 -4
  55. holidays/locale/kl/LC_MESSAGES/GL.mo +0 -0
  56. holidays/locale/kl/LC_MESSAGES/GL.po +91 -0
  57. holidays/locale/ms_MY/LC_MESSAGES/MY.mo +0 -0
  58. holidays/locale/ms_MY/LC_MESSAGES/MY.po +250 -0
  59. holidays/locale/ru/LC_MESSAGES/RU.mo +0 -0
  60. holidays/locale/ru/LC_MESSAGES/RU.po +11 -2
  61. holidays/locale/uk/LC_MESSAGES/GE.mo +0 -0
  62. holidays/locale/uk/LC_MESSAGES/GE.po +8 -4
  63. holidays/mixins.py +31 -0
  64. holidays/observed_holiday_base.py +66 -37
  65. holidays/registry.py +12 -1
  66. {holidays-0.48.dist-info → holidays-0.50.dist-info}/AUTHORS +3 -0
  67. {holidays-0.48.dist-info → holidays-0.50.dist-info}/METADATA +14 -6
  68. {holidays-0.48.dist-info → holidays-0.50.dist-info}/RECORD +71 -57
  69. {holidays-0.48.dist-info → holidays-0.50.dist-info}/LICENSE +0 -0
  70. {holidays-0.48.dist-info → holidays-0.50.dist-info}/WHEEL +0 -0
  71. {holidays-0.48.dist-info → holidays-0.50.dist-info}/top_level.txt +0 -0
@@ -11,7 +11,7 @@
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
13
  from datetime import date
14
- from typing import Tuple
14
+ from typing import Optional, Tuple
15
15
 
16
16
  from holidays.calendars.gregorian import JAN, APR, MAY, JUN, JUL, SEP, OCT, DEC
17
17
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
@@ -19,6 +19,8 @@ from holidays.observed_holiday_base import (
19
19
  ObservedHolidayBase,
20
20
  SAT_SUN_TO_NEXT_WORKDAY,
21
21
  SUN_TO_NEXT_WORKDAY,
22
+ SAT_TO_NONE,
23
+ SUN_TO_NONE,
22
24
  )
23
25
 
24
26
 
@@ -54,7 +56,7 @@ class Jersey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
54
56
  kwargs.setdefault("observed_rule", SAT_SUN_TO_NEXT_WORKDAY)
55
57
  ObservedHolidayBase.__init__(self, *args, **kwargs)
56
58
 
57
- def _add_observed(self, dt: date, **kwargs) -> Tuple[bool, date]:
59
+ def _add_observed(self, dt: date, **kwargs) -> Tuple[bool, Optional[date]]:
58
60
  # Prior to 2004, in-lieu are only given for Sundays.
59
61
  # https://www.jerseylaw.je/laws/enacted/Pages/RO-123-2004.aspx
60
62
  kwargs.setdefault(
@@ -139,14 +141,12 @@ class Jersey(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stat
139
141
  # Liberation Day.
140
142
  # Started in 1952. This has no in-lieus.
141
143
  # Counts as Public Holiday when fall on the weekdays, also on Saturday from 2010 onwards.
142
- # Specially held in 2010 on Sunday for the 65th Anniversary.
143
144
 
144
- # Liberation Day
145
- liberation_day = self._add_holiday_may_9("Liberation Day")
146
- if (self._is_sunday(liberation_day) and self._year != 2010) or (
147
- self._is_saturday(liberation_day) and self._year <= 2010
148
- ):
149
- self.pop(liberation_day)
145
+ self._add_observed(
146
+ # Liberation Day
147
+ self._add_holiday_may_9("Liberation Day"),
148
+ rule=SAT_TO_NONE + SUN_TO_NONE if self._year <= 2010 else SUN_TO_NONE,
149
+ )
150
150
 
151
151
 
152
152
  class JE(Jersey):
@@ -207,6 +207,8 @@ class JerseyStaticHolidays:
207
207
  1999: (DEC, 31, "Millennium Celebrations"),
208
208
  2001: (JUL, 13, elizabeth_2_royal_visit),
209
209
  2002: (JUN, 3, "Golden Jubilee of Elizabeth II"),
210
+ # Specially held in 2010 on Sunday for the 65th Anniversary.
211
+ 2010: (MAY, 9, "Liberation Day"),
210
212
  2011: (APR, 29, "Wedding of William and Catherine"),
211
213
  2012: (JUN, 5, "Diamond Jubilee of Elizabeth II"),
212
214
  2020: (MAY, 8, "75th Anniversary of VE Day"),
@@ -104,29 +104,13 @@ class Laos(ObservedHolidayBase, InternationalHolidays, StaticHolidays, ThaiCalen
104
104
  # - CASE FRI/SAT/SUN: WED-THU-FRI
105
105
 
106
106
  # Lao Year-End Bank Holiday.
107
- year_end_bank_holiday = tr("ສາມວັນລັດຖະການສຸດທ້າຍຂອງທຸກໆປີ")
108
-
109
- dec_31 = (DEC, 31)
110
- if self._is_monday(dec_31):
111
- self._add_holiday_last_thu_of_dec(year_end_bank_holiday)
112
- self._add_holiday_last_fri_of_dec(year_end_bank_holiday)
113
- self._add_holiday_last_mon_of_dec(year_end_bank_holiday)
114
- elif self._is_tuesday(dec_31):
115
- self._add_holiday_last_fri_of_dec(year_end_bank_holiday)
116
- self._add_holiday_last_mon_of_dec(year_end_bank_holiday)
117
- self._add_holiday_last_tue_of_dec(year_end_bank_holiday)
118
- elif self._is_wednesday(dec_31):
119
- self._add_holiday_last_mon_of_dec(year_end_bank_holiday)
120
- self._add_holiday_last_tue_of_dec(year_end_bank_holiday)
121
- self._add_holiday_last_wed_of_dec(year_end_bank_holiday)
122
- elif self._is_thursday(dec_31):
123
- self._add_holiday_last_tue_of_dec(year_end_bank_holiday)
124
- self._add_holiday_last_wed_of_dec(year_end_bank_holiday)
125
- self._add_holiday_last_thu_of_dec(year_end_bank_holiday)
126
- else:
127
- self._add_holiday_last_wed_of_dec(year_end_bank_holiday)
128
- self._add_holiday_last_thu_of_dec(year_end_bank_holiday)
129
- self._add_holiday_last_fri_of_dec(year_end_bank_holiday)
107
+ name = tr("ສາມວັນລັດຖະການສຸດທ້າຍຂອງທຸກໆປີ")
108
+
109
+ last_workday = self._add_holiday(
110
+ name, self._get_next_workday(self._next_year_new_years_day, -1)
111
+ )
112
+ second_to_last_workday = self._add_holiday(name, self._get_next_workday(last_workday, -1))
113
+ self._add_holiday(name, self._get_next_workday(second_to_last_workday, -1))
130
114
 
131
115
  def _populate_public_holidays(self):
132
116
  # Available post-Lao PDR proclamation on Dec 2, 1975.
@@ -10,10 +10,9 @@
10
10
  # Website: https://github.com/vacanza/python-holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import timedelta as td
14
13
  from gettext import gettext as tr
15
14
 
16
- from holidays.calendars.gregorian import MAY, SUN, _get_nth_weekday_of_month
15
+ from holidays.calendars.gregorian import MAY, SUN, _timedelta, _get_nth_weekday_of_month
17
16
  from holidays.groups import ChristianHolidays, InternationalHolidays
18
17
  from holidays.holiday_base import HolidayBase
19
18
 
@@ -70,7 +69,7 @@ class Madagascar(HolidayBase, ChristianHolidays, InternationalHolidays):
70
69
  self._add_holiday(
71
70
  # Mother's Day.
72
71
  tr("Fetin'ny reny"),
73
- last_sun_of_may + td(days=+7) if last_sun_of_may == whit_sunday else last_sun_of_may,
72
+ _timedelta(last_sun_of_may, +7) if last_sun_of_may == whit_sunday else last_sun_of_may,
74
73
  )
75
74
 
76
75
  # Father's Day.