holidays 0.49__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 (38) hide show
  1. holidays/__init__.py +12 -1
  2. holidays/countries/__init__.py +1 -0
  3. holidays/countries/botswana.py +19 -9
  4. holidays/countries/chile.py +14 -11
  5. holidays/countries/georgia.py +17 -1
  6. holidays/countries/greenland.py +96 -0
  7. holidays/countries/isle_of_man.py +3 -8
  8. holidays/countries/italy.py +161 -129
  9. holidays/countries/japan.py +38 -30
  10. holidays/countries/jersey.py +9 -7
  11. holidays/countries/monaco.py +4 -6
  12. holidays/countries/russia.py +18 -4
  13. holidays/countries/switzerland.py +16 -14
  14. holidays/deprecation.py +33 -0
  15. holidays/locale/da/LC_MESSAGES/GL.mo +0 -0
  16. holidays/locale/da/LC_MESSAGES/GL.po +91 -0
  17. holidays/locale/en_US/LC_MESSAGES/GE.mo +0 -0
  18. holidays/locale/en_US/LC_MESSAGES/GE.po +8 -4
  19. holidays/locale/en_US/LC_MESSAGES/GL.mo +0 -0
  20. holidays/locale/en_US/LC_MESSAGES/GL.po +92 -0
  21. holidays/locale/en_US/LC_MESSAGES/RU.mo +0 -0
  22. holidays/locale/en_US/LC_MESSAGES/RU.po +11 -2
  23. holidays/locale/ka/LC_MESSAGES/GE.mo +0 -0
  24. holidays/locale/ka/LC_MESSAGES/GE.po +8 -4
  25. holidays/locale/kl/LC_MESSAGES/GL.mo +0 -0
  26. holidays/locale/kl/LC_MESSAGES/GL.po +91 -0
  27. holidays/locale/ru/LC_MESSAGES/RU.mo +0 -0
  28. holidays/locale/ru/LC_MESSAGES/RU.po +11 -2
  29. holidays/locale/uk/LC_MESSAGES/GE.mo +0 -0
  30. holidays/locale/uk/LC_MESSAGES/GE.po +8 -4
  31. holidays/observed_holiday_base.py +42 -25
  32. holidays/registry.py +11 -1
  33. {holidays-0.49.dist-info → holidays-0.50.dist-info}/AUTHORS +3 -0
  34. {holidays-0.49.dist-info → holidays-0.50.dist-info}/METADATA +8 -3
  35. {holidays-0.49.dist-info → holidays-0.50.dist-info}/RECORD +38 -30
  36. {holidays-0.49.dist-info → holidays-0.50.dist-info}/LICENSE +0 -0
  37. {holidays-0.49.dist-info → holidays-0.50.dist-info}/WHEEL +0 -0
  38. {holidays-0.49.dist-info → holidays-0.50.dist-info}/top_level.txt +0 -0
holidays/__init__.py CHANGED
@@ -12,13 +12,24 @@
12
12
 
13
13
  # flake8: noqa: F403
14
14
 
15
+ import warnings
16
+
15
17
  from holidays.constants import *
18
+ from holidays.deprecation import (
19
+ FUTURE_INCOMPATIBILITY_WARNING_TEMPLATE,
20
+ FutureIncompatibilityWarning,
21
+ )
16
22
  from holidays.holiday_base import *
17
23
  from holidays.registry import EntityLoader
18
24
  from holidays.utils import *
19
25
 
20
- __version__ = "0.49"
26
+ __version__ = "0.50"
21
27
 
22
28
 
23
29
  EntityLoader.load("countries", globals())
24
30
  EntityLoader.load("financial", globals())
31
+
32
+ warnings.warn(
33
+ FUTURE_INCOMPATIBILITY_WARNING_TEMPLATE.format(version=__version__),
34
+ FutureIncompatibilityWarning,
35
+ )
@@ -67,6 +67,7 @@ from .georgia import Georgia, GE, GEO
67
67
  from .germany import Germany, DE, DEU
68
68
  from .ghana import Ghana, GH, GHA
69
69
  from .greece import Greece, GR, GRC
70
+ from .greenland import Greenland, GL, GRL
70
71
  from .guam import Guam, GU, GUM, HolidaysGU
71
72
  from .guatemala import Guatemala, GT, GUA
72
73
  from .honduras import Honduras, HN, HND
@@ -12,7 +12,12 @@
12
12
 
13
13
  from holidays.calendars.gregorian import JUL
14
14
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
15
- from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON, SUN_TO_NEXT_TUE
15
+ from holidays.observed_holiday_base import (
16
+ ObservedHolidayBase,
17
+ SAT_TO_NEXT_MON,
18
+ SUN_TO_NEXT_MON,
19
+ SUN_TO_NEXT_TUE,
20
+ )
16
21
 
17
22
 
18
23
  class Botswana(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
@@ -41,16 +46,19 @@ class Botswana(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St
41
46
  self._add_observed(self._add_new_years_day("New Year's Day"), rule=SUN_TO_NEXT_TUE)
42
47
  self._add_observed(self._add_new_years_day_two("New Year's Day Holiday"))
43
48
 
44
- # Easter and easter related calculations
45
49
  self._add_good_friday("Good Friday")
50
+
46
51
  self._add_holy_saturday("Holy Saturday")
52
+
47
53
  self._add_easter_monday("Easter Monday")
48
- self._add_ascension_thursday("Ascension Day")
49
54
 
50
- may_1 = self._add_labor_day("Labour Day")
51
- self._add_observed(may_1)
52
- if self.observed and self._year >= 2016 and self._is_saturday(may_1):
53
- self._add_labor_day_three("Labour Day Holiday")
55
+ self._add_observed(may_1 := self._add_labor_day("Labour Day"))
56
+ if self._year >= 2016:
57
+ self._add_observed(
58
+ may_1, name="Labour Day Holiday", rule=SAT_TO_NEXT_MON, show_observed_label=False
59
+ )
60
+
61
+ self._add_ascension_thursday("Ascension Day")
54
62
 
55
63
  self._add_observed(self._add_holiday_jul_1("Sir Seretse Khama Day"))
56
64
 
@@ -63,8 +71,10 @@ class Botswana(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, St
63
71
  self._add_observed(self._add_christmas_day("Christmas Day"), rule=SUN_TO_NEXT_TUE)
64
72
  self._add_observed(dec_26 := self._add_christmas_day_two("Boxing Day"))
65
73
 
66
- if self.observed and self._year >= 2016 and self._is_saturday(dec_26):
67
- self._add_holiday_dec_28("Boxing Day Holiday")
74
+ if self._year >= 2016:
75
+ self._add_observed(
76
+ dec_26, name="Boxing Day Holiday", rule=SAT_TO_NEXT_MON, show_observed_label=False
77
+ )
68
78
 
69
79
 
70
80
  class BW(Botswana):
@@ -17,8 +17,11 @@ from holidays.calendars.gregorian import JUN, SEP
17
17
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
18
18
  from holidays.observed_holiday_base import (
19
19
  ObservedHolidayBase,
20
+ MON_ONLY,
21
+ MON_FRI_ONLY,
20
22
  TUE_TO_PREV_FRI,
21
23
  WED_TO_NEXT_FRI,
24
+ FRI_ONLY,
22
25
  WORKDAY_TO_NEAREST_MON,
23
26
  )
24
27
 
@@ -84,9 +87,9 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
84
87
  return None
85
88
 
86
89
  # New Year's Day.
87
- jan_1 = self._add_new_years_day(tr("Año Nuevo"))
88
- if self._year >= 2017 and self._is_sunday(jan_1):
89
- self._add_new_years_day_two(tr("Feriado nacional"))
90
+ self._add_new_years_day(tr("Año Nuevo"))
91
+ if self._year >= 2017:
92
+ self._add_observed(self._add_new_years_day_two(tr("Feriado nacional")), rule=MON_ONLY)
90
93
 
91
94
  # Good Friday.
92
95
  self._add_good_friday(tr("Viernes Santo"))
@@ -141,12 +144,12 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
141
144
  tr("Día de la Unidad Nacional")
142
145
  )
143
146
 
144
- if self._year >= 2017 and self._is_saturday(SEP, 18):
145
- # National Holiday.
146
- self._add_holiday_sep_17(tr("Fiestas Patrias"))
147
-
148
- if self._year >= 2007 and self._is_tuesday(SEP, 18):
149
- self._add_holiday_sep_17(tr("Fiestas Patrias"))
147
+ if self._year >= 2007:
148
+ self._add_observed(
149
+ # National Holiday.
150
+ self._add_holiday_sep_17(tr("Fiestas Patrias")),
151
+ rule=MON_FRI_ONLY if self._year >= 2017 else MON_ONLY,
152
+ )
150
153
 
151
154
  # Independence Day.
152
155
  self._add_holiday_sep_18(tr("Día de la Independencia"))
@@ -154,8 +157,8 @@ class Chile(ObservedHolidayBase, ChristianHolidays, InternationalHolidays, Stati
154
157
  # Army Day.
155
158
  self._add_holiday_sep_19(tr("Día de las Glorias del Ejército"))
156
159
 
157
- if self._year >= 2008 and self._is_thursday(SEP, 19):
158
- self._add_holiday_sep_20(tr("Fiestas Patrias"))
160
+ if self._year >= 2008:
161
+ self._add_observed(self._add_holiday_sep_20(tr("Fiestas Patrias")), rule=FRI_ONLY)
159
162
 
160
163
  if 1932 <= self._year <= 1944:
161
164
  self._add_holiday_sep_20(tr("Fiestas Patrias"))
@@ -12,8 +12,10 @@
12
12
 
13
13
  from gettext import gettext as tr
14
14
 
15
+ from holidays.calendars.gregorian import MAY
15
16
  from holidays.calendars.julian import JULIAN_CALENDAR
16
- from holidays.groups import ChristianHolidays, InternationalHolidays
17
+ from holidays.constants import GOVERNMENT, PUBLIC
18
+ from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
17
19
  from holidays.holiday_base import HolidayBase
18
20
 
19
21
 
@@ -27,12 +29,14 @@ class Georgia(HolidayBase, ChristianHolidays, InternationalHolidays):
27
29
  """
28
30
 
29
31
  country = "GE"
32
+ supported_categories = (GOVERNMENT, PUBLIC)
30
33
  default_language = "ka"
31
34
  supported_languages = ("en_US", "ka", "uk")
32
35
 
33
36
  def __init__(self, *args, **kwargs):
34
37
  ChristianHolidays.__init__(self, JULIAN_CALENDAR)
35
38
  InternationalHolidays.__init__(self)
39
+ StaticHolidays.__init__(self, GeorgiaStaticHolidays)
36
40
  super().__init__(*args, **kwargs)
37
41
 
38
42
  def _populate_public_holidays(self):
@@ -96,3 +100,15 @@ class GE(Georgia):
96
100
 
97
101
  class GEO(Georgia):
98
102
  pass
103
+
104
+
105
+ class GeorgiaStaticHolidays:
106
+ """
107
+ References:
108
+ - https://www.matsne.gov.ge/ka/document/view/6173967
109
+ """
110
+
111
+ special_government_holidays = {
112
+ # Day of Family Sanctity and Respect for Parents.
113
+ 2024: (MAY, 17, tr("ოჯახის სიწმინდისა და მშობლების პატივისცემის დღე")),
114
+ }
@@ -0,0 +1,96 @@
1
+ # holidays
2
+ # --------
3
+ # A fast, efficient Python library for generating country, province and state
4
+ # specific sets of holidays on the fly. It aims to make determining whether a
5
+ # specific date is a holiday as fast and flexible as possible.
6
+ #
7
+ # Authors: Vacanza Team and individual contributors (see AUTHORS file)
8
+ # dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023
9
+ # ryanss <ryanssdev@icloud.com> (c) 2014-2017
10
+ # Website: https://github.com/vacanza/python-holidays
11
+ # License: MIT (see LICENSE file)
12
+
13
+ from gettext import gettext as tr
14
+
15
+ from holidays.constants import OPTIONAL, PUBLIC
16
+ from holidays.groups import ChristianHolidays, InternationalHolidays
17
+ from holidays.holiday_base import HolidayBase
18
+
19
+
20
+ class Greenland(HolidayBase, ChristianHolidays, InternationalHolidays):
21
+ """
22
+ Greenlandic holidays.
23
+
24
+ References:
25
+ - https://en.wikipedia.org/wiki/Public_holidays_in_Greenland
26
+ - https://www.norden.org/en/info-norden/public-holidays-greenland
27
+ - https://www.timeanddate.com/holidays/greenland/
28
+ """
29
+
30
+ country = "GL"
31
+ default_language = "kl"
32
+ supported_categories = (OPTIONAL, PUBLIC)
33
+ supported_languages = ("da", "en_US", "kl")
34
+
35
+ def __init__(self, *args, **kwargs):
36
+ ChristianHolidays.__init__(self)
37
+ InternationalHolidays.__init__(self)
38
+ super().__init__(*args, **kwargs)
39
+
40
+ def _populate_public_holidays(self):
41
+ # New Year's Day.
42
+ self._add_new_years_day(tr("Ukioq nutaaq"))
43
+
44
+ # Maundy Thursday.
45
+ self._add_holy_thursday(tr("Sisamanngornermi illernartumi"))
46
+
47
+ # Good Friday.
48
+ self._add_good_friday(tr("Tallimanngorneq ajortorsiorneq"))
49
+
50
+ # Easter Sunday.
51
+ self._add_easter_sunday(tr("Poorskimi"))
52
+
53
+ # Easter Monday.
54
+ self._add_easter_monday(tr("Poorskimi ullut aappaat"))
55
+
56
+ # Great Day of Prayers.
57
+ self._add_holiday_26_days_past_easter(tr("Ulloq qinuffiusoq"))
58
+
59
+ # Ascension Day.
60
+ self._add_ascension_thursday(tr("Ulloq Kristusip qilaliarnera"))
61
+
62
+ # Whit Sunday.
63
+ self._add_whit_sunday(tr("Piinsip ullua"))
64
+
65
+ # Whit Monday.
66
+ self._add_whit_monday(tr("Piinsip ulluisa aappaanni"))
67
+
68
+ # Christmas Day.
69
+ self._add_christmas_day(tr("Juulli"))
70
+
71
+ # Second Day of Christmas.
72
+ self._add_christmas_day_two(tr("Juullip aappaa"))
73
+
74
+ def _populate_optional_holidays(self):
75
+ # Epiphany.
76
+ self._add_epiphany_day(tr("Mitaarneq"))
77
+
78
+ # International Workers' Day.
79
+ self._add_labor_day(tr("Sulisartut ulluat"))
80
+
81
+ # National Day.
82
+ self._add_holiday_jun_21(tr("Ullortuneq"))
83
+
84
+ # Christmas Eve.
85
+ self._add_christmas_eve(tr("Juulliaqqami"))
86
+
87
+ # New Year's Eve.
88
+ self._add_new_years_eve(tr("Ukiortaami"))
89
+
90
+
91
+ class GL(Greenland):
92
+ pass
93
+
94
+
95
+ class GRL(Greenland):
96
+ pass
@@ -10,9 +10,6 @@
10
10
  # Website: https://github.com/vacanza/python-holidays
11
11
  # License: MIT (see LICENSE file)
12
12
 
13
- from datetime import date
14
-
15
- from holidays.calendars.gregorian import JUL
16
13
  from holidays.countries.united_kingdom import UnitedKingdom, UnitedKingdomStaticHolidays
17
14
  from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
18
15
  from holidays.observed_holiday_base import ObservedHolidayBase, SAT_SUN_TO_NEXT_MON
@@ -50,11 +47,9 @@ class IsleOfMan(UnitedKingdom):
50
47
 
51
48
  # Tynwald Day
52
49
  # Move to the next Monday if falls on a weekend.
53
- dt = date(self._year, JUL, 5)
54
- self._add_holiday(
55
- "Tynwald Day",
56
- self._get_observed_date(dt, SAT_SUN_TO_NEXT_MON) if self._year >= 1992 else dt,
57
- )
50
+ jul_5 = self._add_holiday_jul_5("Tynwald Day")
51
+ if self._year >= 1992:
52
+ self._move_holiday(jul_5, show_observed_label=False)
58
53
 
59
54
 
60
55
  class IM(IsleOfMan):