Skip to content

Commit

Permalink
Merge pull request #1763 from vacanza/dev
Browse files Browse the repository at this point in the history
v0.47
  • Loading branch information
arkid15r committed Apr 15, 2024
2 parents 6b5535b + eaec226 commit d8bb55f
Show file tree
Hide file tree
Showing 61 changed files with 1,973 additions and 740 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-ast
- id: check-builtin-literals
Expand All @@ -19,7 +19,7 @@ repos:
- rst

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
rev: v0.3.7
hooks:
- id: ruff
- id: ruff-format
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Eugenio Panadero Maciá
Fabian Affolter
Felix Lee
Filip Bednárik
Firas Kafri
Gabriel L Martinez
Gabriel Trabanco
Giedrius Mauza
Expand Down
15 changes: 15 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Version 0.47
============

Released April 15, 2024

- Refactor some sequential holidays (#1750 by @KJhellico)
- Add Jordan holidays (#1746 by @firaskafri, @arkid15r)
- Change contributors badge placement (#1753 by @arkid15r)
- Update Australia holidays: fix Sovereign's Birthday dates in WA (#1757 by @KJhellico)
- Update Eid al-Fitr 2024 dates (#1758 by @KJhellico)
- Update European Central Bank holidays (#1754 by @KJhellico)
- Update Poland holidays: fix Ascension Day (#1751 by @KJhellico)
- Update South Africa holidays: add public holiday on May 29, 2024 (#1749 by @KJhellico)
- Update contributing guidelines (#1752 by @arkid15r)

Version 0.46
============

Expand Down
21 changes: 16 additions & 5 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ Contributing

.. _prs: https://github.com/vacanza/python-holidays/pulls
.. _`dev branch`: https://github.com/vacanza/python-holidays/tree/dev
.. |contributors| image:: https://img.shields.io/github/contributors/vacanza/python-holidays
:target: https://github.com/vacanza/python-holidays/graphs/contributors
:alt: contributors

|contributors|


Basics
Expand Down Expand Up @@ -114,6 +109,7 @@ initialize the ``setUpClass`` properly:
def setUpClass(cls):
super().setUpClass(Argentina)
Build sphinx documentation
--------------------------

Expand All @@ -127,3 +123,18 @@ with reStructuredText for Sphinx you can read a primer
`here`__.

__ https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html


Contributors
------------

.. __: https://github.com/vacanza/python-holidays/blob/dev/AUTHORS
.. |contributors| image:: https://img.shields.io/github/contributors/vacanza/python-holidays
:target: https://github.com/vacanza/python-holidays/graphs/contributors
:alt: contributors

In order to keep the list of contributors up to date we encourage you add your
name (in alphabetical order) to the `AUTHORS`__ file if it's not there yet.
Thanks for your contribution!

|contributors|
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Available Countries
.. _ISO 639-1 code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _ISO 639-2 code: https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes

We currently support 145 country codes. The standard way to refer to a country
We currently support 146 country codes. The standard way to refer to a country
is by using its `ISO 3166-1 alpha-2 code`_, the same used for domain names, and
for a subdivision its `ISO 3166-2 code`_. Some countries have common or foreign
names or abbreviations as aliases for their subdivisions. These are defined in
Expand Down Expand Up @@ -535,6 +535,11 @@ All other default values are highlighted with bold:
-
-
-
* - Jordan
- JO
-
- **ar**, en_US
-
* - Kazakhstan
- KZ
-
Expand Down
2 changes: 1 addition & 1 deletion holidays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from holidays.registry import EntityLoader
from holidays.utils import *

__version__ = "0.46"
__version__ = "0.47"


EntityLoader.load("countries", globals())
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
from .jamaica import Jamaica, JM, JAM
from .japan import Japan, JP, JPN
from .jersey import Jersey, JE, JEY
from .jordan import Jordan, JO, JOR
from .kazakhstan import Kazakhstan, KZ, KAZ
from .kenya import Kenya, KE, KEN
from .kuwait import Kuwait, KW, KWT
Expand Down
38 changes: 18 additions & 20 deletions holidays/countries/andorra.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
# Website: https://github.com/vacanza/python-holidays
# License: MIT (see LICENSE file)

from datetime import timedelta as td

from holidays.groups import ChristianHolidays, InternationalHolidays
from holidays.holiday_base import HolidayBase

Expand Down Expand Up @@ -85,48 +83,48 @@ def _populate_public_holidays(self) -> None:
# Canillo.
def _populate_subdiv_02_public_holidays(self):
name = "Canillo Annual Festival"
third_sat_of_july = self._add_holiday_3rd_sat_of_jul(name)
self._add_holiday(name, third_sat_of_july + td(days=+1))
self._add_holiday(name, third_sat_of_july + td(days=+2))
self._add_holiday_3rd_sat_of_jul(name)
self._add_holiday_1_day_past_3rd_sat_of_jul(name)
self._add_holiday_2_days_past_3rd_sat_of_jul(name)

# Encamp.
def _populate_subdiv_03_public_holidays(self):
name = "Encamp Annual Festival"
aug_15 = self._add_holiday_aug_15(name)
self._add_holiday(name, aug_15 + td(days=+1))
self._add_holiday_aug_15(name)
self._add_holiday_aug_16(name)

# La Massana.
def _populate_subdiv_04_public_holidays(self):
name = "La Massana Annual Festival"
aug_15 = self._add_holiday_aug_15(name)
self._add_holiday(name, aug_15 + td(days=+1))
self._add_holiday_aug_15(name)
self._add_holiday_aug_16(name)

# Ordino.
def _populate_subdiv_05_public_holidays(self):
name = "Ordino Annual Festival"
aug_15 = self._add_holiday_aug_15(name)
self._add_holiday(name, aug_15 + td(days=+1))
self._add_holiday_aug_15(name)
self._add_holiday_aug_16(name)

# Sant Julià de Lòria.
def _populate_subdiv_06_public_holidays(self):
name = "Sant Julià de Lòria Annual Festival"
last_fri_of_july = self._add_holiday_1st_fri_before_jul_29(name)
self._add_holiday(name, last_fri_of_july + td(days=+1))
self._add_holiday(name, last_fri_of_july + td(days=+2))
self._add_holiday(name, last_fri_of_july + td(days=+3))
self._add_holiday_1st_fri_before_jul_29(name)
self._add_holiday_1st_sat_before_jul_30(name)
self._add_holiday_1st_sun_before_jul_31(name)
self._add_holiday_1st_mon_before_aug_1(name)

# Andorra la Vella.
def _populate_subdiv_07_public_holidays(self):
name = "Andorra la Vella Annual Festival"
first_sat_of_august = self._add_holiday_1st_sat_of_aug(name)
self._add_holiday(name, first_sat_of_august + td(days=+1))
self._add_holiday(name, first_sat_of_august + td(days=+2))
self._add_holiday_1st_sat_of_aug(name)
self._add_holiday_1_day_past_1st_sat_of_aug(name)
self._add_holiday_2_days_past_1st_sat_of_aug(name)

# Escaldes-Engordany.
def _populate_subdiv_08_public_holidays(self):
name = "Escaldes-Engordany Annual Festival"
jul_25 = self._add_holiday_jul_25(name)
self._add_holiday(name, jul_25 + td(days=+1))
self._add_holiday_jul_25(name)
self._add_holiday_jul_26(name)


class AD(Andorra):
Expand Down
19 changes: 18 additions & 1 deletion holidays/countries/australia.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,19 @@ def _populate_subdiv_wa_public_holidays(self):
# Sovereign's Birthday.
if self._year >= 1936:
if self._year >= 1984:
self._add_holiday_last_mon_of_sep(self.sovereign_birthday)
# Celebration Day for the Anniversary of the Birthday of the Reigning Sovereign
# to be appointed for each year by proclamation published in the Government Gazette
sovereign_birthday_dates = {
2011: (OCT, 28),
2012: (OCT, 1),
2024: (SEP, 23),
}
if self._year in sovereign_birthday_dates:
self._add_holiday(
self.sovereign_birthday, sovereign_birthday_dates[self._year]
)
else:
self._add_holiday_last_mon_of_sep(self.sovereign_birthday)
else:
self._add_holiday_2nd_mon_of_oct(self.sovereign_birthday)

Expand Down Expand Up @@ -945,3 +957,8 @@ class AustraliaStaticHolidays:
2010: (DEC, 28, "Christmas Day"),
2011: (JAN, 3, "New Year's Day"),
}

special_wa_public_holidays = {
# In 2011 both ANZAC Day and Easter Monday fell on Monday 25 April.
2011: (APR, 26, "Special public holiday"),
}
1 change: 1 addition & 0 deletions holidays/countries/azerbaijan.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ class AzerbaijanIslamicHolidays(_CustomIslamicHolidays):
2021: (MAY, 13),
2022: (MAY, 2),
2023: (APR, 21),
2024: (APR, 10),
}


Expand Down
1 change: 1 addition & 0 deletions holidays/countries/bosnia_and_herzegovina.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,5 @@ class BosniaAndHerzegovinaIslamicHolidays(_CustomIslamicHolidays):
2021: (MAY, 13),
2022: (MAY, 2),
2023: (APR, 21),
2024: (APR, 10),
}
13 changes: 5 additions & 8 deletions holidays/countries/botswana.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
# Website: https://github.com/vacanza/python-holidays
# License: MIT (see LICENSE file)

from datetime import timedelta as td

from holidays.calendars.gregorian import JUL
from holidays.groups import ChristianHolidays, InternationalHolidays, StaticHolidays
from holidays.observed_holiday_base import ObservedHolidayBase, SUN_TO_NEXT_MON, SUN_TO_NEXT_TUE
Expand Down Expand Up @@ -56,18 +54,17 @@ def _populate_public_holidays(self):

self._add_observed(self._add_holiday_jul_1("Sir Seretse Khama Day"))

third_mon_of_jul = self._add_holiday_3rd_mon_of_jul("President's Day")
self._add_holiday("President's Day Holiday", third_mon_of_jul + td(days=+1))
self._add_holiday_3rd_mon_of_jul("President's Day")
self._add_holiday_1_day_past_3rd_mon_of_jul("President's Day Holiday")

sep_30 = self._add_holiday_sep_30("Botswana Day")
self._add_observed(sep_30, rule=SUN_TO_NEXT_TUE)
self._add_observed(self._add_holiday("Botswana Day Holiday", sep_30 + td(days=+1)))
self._add_observed(self._add_holiday_sep_30("Botswana Day"), rule=SUN_TO_NEXT_TUE)
self._add_observed(self._add_holiday_oct_1("Botswana Day Holiday"))

self._add_observed(self._add_christmas_day("Christmas Day"), rule=SUN_TO_NEXT_TUE)
self._add_observed(dec_26 := self._add_christmas_day_two("Boxing Day"))

if self.observed and self._year >= 2016 and self._is_saturday(dec_26):
self._add_holiday("Boxing Day Holiday", dec_26 + td(days=+2))
self._add_holiday_dec_28("Boxing Day Holiday")


class BW(Botswana):
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/brunei.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ class BruneiIslamicHolidays(_CustomIslamicHolidays):
2021: (MAY, 13),
2022: (MAY, 3),
2023: (APR, 22),
2024: (APR, 10),
}

HIJRI_NEW_YEAR_DATES = {
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/burkina_faso.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class BurkinaFasoIslamicHolidays(_CustomIslamicHolidays):
2021: (MAY, 13),
2022: (MAY, 2),
2023: (APR, 21),
2024: (APR, 10),
}

MAWLID_DATES = {
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/cameroon.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ class CameroonIslamicHolidays(_CustomIslamicHolidays):
2021: (MAY, 13),
2022: (MAY, 2),
2023: (APR, 21),
2024: (APR, 10),
}

MAWLID_DATES = {
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/chad.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class ChadIslamicHolidays(_CustomIslamicHolidays):
2021: (MAY, 13),
2022: (MAY, 2),
2023: (APR, 21),
2024: (APR, 10),
}

MAWLID_DATES = {
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/ethiopia.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class EthiopiaIslamicHolidays(_CustomIslamicHolidays):
2021: (MAY, 13),
2022: (MAY, 2),
2023: (APR, 21),
2024: (APR, 10),
}

MAWLID_DATES = {
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/gabon.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,5 @@ class GabonIslamicHolidays(_CustomIslamicHolidays):
2021: (MAY, 13),
2022: (MAY, 2),
2023: (APR, 21),
2024: (APR, 10),
}
7 changes: 3 additions & 4 deletions holidays/countries/honduras.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# Website: https://github.com/vacanza/python-holidays
# License: MIT (see LICENSE file)

from datetime import timedelta as td
from gettext import gettext as tr

from holidays.groups import ChristianHolidays, InternationalHolidays
Expand Down Expand Up @@ -66,9 +65,9 @@ def _populate_public_holidays(self):
# Morazan Weekend.
name = tr("Semana Morazánica")
# First Wednesday of October from 12 noon to Saturday 12 noon.
first_wed_of_oct = self._add_holiday_1st_wed_of_oct(name)
self._add_holiday(name, first_wed_of_oct + td(days=+1))
self._add_holiday(name, first_wed_of_oct + td(days=+2))
self._add_holiday_1st_wed_of_oct(name)
self._add_holiday_1_day_past_1st_wed_of_oct(name)
self._add_holiday_2_days_past_1st_wed_of_oct(name)

# Christmas Day.
self._add_christmas_day(tr("Navidad"))
Expand Down
1 change: 1 addition & 0 deletions holidays/countries/indonesia.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ class IndonesiaIslamicHolidays(_CustomIslamicHolidays):
2021: (MAY, 13),
2022: (MAY, 2),
2023: (APR, 22),
2024: (APR, 10),
}

HIJRI_NEW_YEAR_DATES = {
Expand Down

0 comments on commit d8bb55f

Please sign in to comment.