Skip to content

Commit

Permalink
Merge pull request #2300 from vacanza/dev
Browse files Browse the repository at this point in the history
v0.67
  • Loading branch information
arkid15r authored Feb 17, 2025
2 parents f51eebf + a662ad9 commit 1413b68
Show file tree
Hide file tree
Showing 273 changed files with 23,208 additions and 10,546 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text eol=lf
*.cmd text eol=crlf
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repos:
- id: mixed-line-ending
args:
- --fix=lf
exclude: make.cmd
- id: trailing-whitespace
exclude_types:
- rst
Expand All @@ -23,7 +24,7 @@ repos:
- --py39-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.4
rev: v0.9.6
hooks:
- id: ruff
- id: ruff-format
Expand Down Expand Up @@ -54,7 +55,7 @@ repos:
exclude: ^(docs)

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
rev: v1.15.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Chanran Kim
Chris McKeague
Chris Turra
Christian Alexander
Colin Watson
Dan Gentry
Daniel Musketa
Daniël Niemeijer
Expand Down
21 changes: 21 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
Version 0.67
============

Released February 17, 2025

- Add Saint Lucia holidays (#2266 by @Prateekshit73)
- Add Tuvalu holidays (#2295 by @Prateekshit73, @arkid15r)
- Update Greenland holidays l10n (#2288 by @KJhellico)
- Update Hong Kong holidays: add l10n support (#2268 by @PPsyrius)
- Update Hong Kong holidays: fix `th` l10n typo (#2293 by @PPsyrius)
- Update Panama holidays, add l10n support (#2275 by @KJhellico)
- Update README: add DOI (#2286 by @arkid15r)
- Update United Kingdom & Isle of Man holidays: add l10n support (#2258 by @PPsyrius, @arkid15r, @KJhellico)
- Update internal scripts (#2284 by @KJhellico)
- Update subdivision names for Presidents' Day in the United States (#2299 by @parkerbxyz, @arkid15r, @KJhellico)
- Add Python syntax check with ruff-pyupgrade rules (#2294 by @KJhellico)
- Add make script for Windows (#2277 by @KJhellico)
- Check .mo rather than .po files in TestListLocalizedEntities (#2273 by @cjwatson, @arkid15r)
- Implement HolidayBase::get_closest_holiday functionality (#2211 by @Rosi2143, @arkid15r)
- Unify certain holidays names translation (#2285 by @KJhellico)

Version 0.66
============

Expand Down
48 changes: 32 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,21 @@ flexible as possible.
:target: https://github.com/vacanza/holidays/commits/dev
:alt: GitHub last commit

+--------+------------------------------------------------+
| PyPI | |downloads| |version| |release date| |
+--------+------------------------------------------------+
| CI/CD | |status| |documentation| |
+--------+------------------------------------------------+
| Code | |license| |python versions| |style| |coverage| |
+--------+------------------------------------------------+
| GitHub | |stars| |forks| |contributors| |last commit| |
+--------+------------------------------------------------+
.. |doi| image:: https://img.shields.io/badge/DOI-10.5281/zenodo.14847397-41B5BE?style=flat
:target: https://doi.org/10.5281/zenodo.14847397
:alt: Open World Holidays Franework DOI

+----------+------------------------------------------------+
| PyPI | |downloads| |version| |release date| |
+----------+------------------------------------------------+
| CI/CD | |status| |documentation| |
+----------+------------------------------------------------+
| Code | |license| |python versions| |style| |coverage| |
+----------+------------------------------------------------+
| GitHub | |stars| |forks| |contributors| |last commit| |
+----------+------------------------------------------------+
| Citation | |doi| |
+----------+------------------------------------------------+

Install
-------
Expand Down Expand Up @@ -146,7 +152,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 157 country codes. The standard way to refer to a country
We currently support 159 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 @@ -473,7 +479,7 @@ All other default values are highlighted with bold:
* - Greenland
- GL
-
- da, en_US, **kl**
- da, en_US, fi, is, **kl**, no, sv, uk
- OPTIONAL
* - Guam
- GU
Expand Down Expand Up @@ -503,7 +509,7 @@ All other default values are highlighted with bold:
* - Hong Kong
- HK
-
-
- en_HK, en_US, th, zh_CN, **zh_HK**
- OPTIONAL
* - Hungary
- HU
Expand Down Expand Up @@ -538,7 +544,7 @@ All other default values are highlighted with bold:
* - Isle of Man
- IM
-
-
- **en_GB**, en_US, th
-
* - Israel
- IL
Expand Down Expand Up @@ -738,8 +744,8 @@ All other default values are highlighted with bold:
* - Panama
- PA
-
-
-
- en_US, **es**, uk
- BANK
* - Papua New Guinea
- PG
-
Expand Down Expand Up @@ -790,6 +796,11 @@ All other default values are highlighted with bold:
-
-
- HALF_DAY, WORKDAY
* - Saint Lucia
- LC
-
- **en_LC**, en_US
-
* - Samoa
- WS
-
Expand Down Expand Up @@ -895,6 +906,11 @@ All other default values are highlighted with bold:
-
- en_US, **tr**, uk
- HALF_DAY
* - Tuvalu
- TV
- Town/Island Councils: FUN (Funafuti), NIT (Niutao), NKF (Nukufetau), NKL (Nukulaelae), NMA (Nanumea), NMG (Nanumaga, Nanumanga), NUI (Nui), VAI (Vaitupu)
- en_GB, en_US, **tvl**
-
* - Ukraine
- UA
-
Expand All @@ -908,7 +924,7 @@ All other default values are highlighted with bold:
* - United Kingdom
- GB
- Subdivisions: ENG (England), NIR (Northern Ireland), SCT (Scotland), WLS (Wales)
-
- **en_GB**, en_US, th
-
* - United States Minor Outlying Islands
- UM
Expand Down
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## Supported Versions

| Version | Supported |
| ------- | ------------------ |
| 0.66 | :white_check_mark: |
| < 0.66 | :x: |
|---------| ------------------ |
| 0.67 | :white_check_mark: |
| < 0.67 | :x: |

## Reporting a Vulnerability

Expand Down
47 changes: 47 additions & 0 deletions docs/source/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,53 @@ To calculate the number or working days between two specified dates:
Here we calculate the number of working days in Q2 2024.

Getting the closest (next or previous) holiday
----------------------------------------------

You can fetch next or previous holiday for a target date of your selected calendar.
The function returns found holiday's date and name excluding the target date.

Get the next holiday for the current date:

.. code-block:: python
>>> us_holidays = holidays.US(years=2025)
>>> us_holidays.get_closest_holiday()
(datetime.date(2025, 1, 20), 'Martin Luther King Jr. Day')
Get the previous holiday for the current date:

.. code-block:: python
>>> us_holidays = holidays.US(years=2025)
>>> us_holidays.get_closest_holiday(direction="backward")
(datetime.date(2025, 1, 1), "New Year's Day")
Get the next holiday for a specific target date:

.. code-block:: python
>>> us_holidays = holidays.US(years=2025)
>>> us_holidays.get_closest_holiday("2025-02-01")
(datetime.date(2025, 2, 17), "Washington's Birthday")
Get the previous holiday for a specific target date:

.. code-block:: python
>>> us_holidays = holidays.US(years=2025)
>>> us_holidays.get_closest_holiday("2025-02-01", direction="backward")
(datetime.date(2025, 1, 20), 'Martin Luther King Jr. Day')
If the closest holiday cannot be found None is returned.

.. code-block:: python
>>> print(us_holidays.get_closest_holiday("2100-12-31"))
None
>>> print(us_holidays.get_closest_holiday("1777-01-01", direction="backward"))
None
Date from holiday name
----------------------

Expand Down
2 changes: 2 additions & 0 deletions holidays/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
from .romania import Romania, RO, ROU
from .russia import Russia, RU, RUS
from .saint_kitts_and_nevis import SaintKittsAndNevis, KN, KNA
from .saint_lucia import SaintLucia, LC, LCA
from .samoa import Samoa, WS, WSM
from .san_marino import SanMarino, SM, SMR
from .saudi_arabia import SaudiArabia, SA, SAU
Expand All @@ -155,6 +156,7 @@
from .tonga import Tonga, TO, TON
from .tunisia import Tunisia, TN, TUN
from .turkey import Turkey, TR, TUR
from .tuvalu import Tuvalu, TV, TUV
from .ukraine import Ukraine, UA, UKR
from .united_arab_emirates import UnitedArabEmirates, AE, ARE
from .united_kingdom import UnitedKingdom, GB, GBR, UK
Expand Down
12 changes: 6 additions & 6 deletions holidays/countries/australia.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def _populate_subdiv_act_public_holidays(self):
# Family & Community Day.
self._add_holiday(tr("Family & Community Day"), fc_dates[self._year])

# Labour Day.
# Labor Day.
self._add_holiday_1st_mon_of_oct(tr("Labour Day"))

# Christmas Day.
Expand Down Expand Up @@ -317,7 +317,7 @@ def _populate_subdiv_nsw_public_holidays(self):
if self._year <= 2010:
self._add_observed(apr_25)

# Labour Day.
# Labor Day.
self._add_holiday_1st_mon_of_oct(tr("Labour Day"))

# Sovereign's Birthday.
Expand Down Expand Up @@ -493,7 +493,7 @@ def _populate_subdiv_qld_public_holidays(self):
else:
self._add_anzac_day(name)

# Labour Day.
# Labor Day.
name = tr("Labour Day")
if 2013 <= self._year <= 2015:
self._add_holiday_1st_mon_of_oct(name)
Expand Down Expand Up @@ -631,7 +631,7 @@ def _populate_subdiv_sa_public_holidays(self):
if self._year >= 1936:
self._add_holiday_2nd_mon_of_jun(self.sovereign_birthday)

# Labour Day.
# Labor Day.
self._add_holiday_1st_mon_of_oct(tr("Labour Day"))

# Proclamation Day.
Expand Down Expand Up @@ -799,7 +799,7 @@ def _populate_subdiv_vic_public_holidays(self):
else:
self._add_holiday_jan_26(self.australia_day)

# Labour Day.
# Labor Day.
self._add_holiday_2nd_mon_of_mar(tr("Labour Day"))

if self._year >= 2003:
Expand Down Expand Up @@ -893,7 +893,7 @@ def _populate_subdiv_wa_public_holidays(self):
else:
self._add_holiday_jan_26(self.australia_day)

# Labour Day.
# Labor Day.
self._add_holiday_1st_mon_of_mar(tr("Labour Day"))

if self._year >= 2022:
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/cambodia.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _populate_public_holidays(self):
# Assumed to start in 1993, defunct from 2020 onwards.

if self._year <= 2019:
# International Children Day
# International Children's Day
self._add_childrens_day(tr("ទិវាកុមារអន្តរជាតិ"))

# ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី ព្រះវររាជមាតា នរោត្តម មុនិនាថ សីហនុ
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/chile.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _populate_public_holidays(self):
self._add_holiday(name, self._summer_solstice_date)

if self._year <= 1967 or self._year >= 1986:
# Saint Peter and Saint Paul.
# Saint Peter and Saint Paul's Day.
self._move_holiday(self._add_saints_peter_and_paul_day(tr("San Pedro y San Pablo")))

if self._year >= 2007:
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/cuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _populate_public_holidays(self):
# Good Friday.
self._add_good_friday(tr("Viernes Santo"))

# International Worker's Day.
# International Workers' Day.
self._add_observed(self._add_labor_day(tr("Día Internacional de los Trabajadores")))

# Commemoration of the Assault of the Moncada garrison.
Expand Down
2 changes: 1 addition & 1 deletion holidays/countries/denmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _populate_public_holidays(self):
self._add_christmas_day_two(tr("Anden juledag"))

def _populate_optional_holidays(self):
# International Workers' Day.
# Workers' Day.
self._add_labor_day(tr("Arbejdernes kampdag"))

# Constitution Day.
Expand Down
Loading

0 comments on commit 1413b68

Please sign in to comment.