Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.67 #2300

Merged
merged 25 commits into from
Feb 17, 2025
Merged

v0.67 #2300

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
915dafb
Initialize v0.67
arkid15r Feb 3, 2025
5d8840b
Bump ruff from 0.9.3 to 0.9.4 (#2271)
dependabot[bot] Feb 6, 2025
3e9c8f0
Update pre-commit hooks (#2272)
github-actions[bot] Feb 6, 2025
d6a18d4
Check .mo rather than .po files in TestListLocalizedEntities (#2273)
cjwatson Feb 6, 2025
7d6feb2
Update Hong Kong holidays: add l10n support (#2268)
PPsyrius Feb 6, 2025
4d02ea3
Add Saint Lucia holidays (#2266)
Prateekshit73 Feb 6, 2025
47010d3
Update pre-commit hooks (#2274)
github-actions[bot] Feb 7, 2025
7c9b3b8
Update Panama holidays, add l10n support (#2275)
KJhellico Feb 9, 2025
7c88dc2
Add make script for Windows (#2277)
KJhellico Feb 9, 2025
cb2a27d
Update internal scripts (#2284)
KJhellico Feb 9, 2025
ecd0117
Update United Kingdom & Isle of Man holidays: add l10n support (#2258)
PPsyrius Feb 10, 2025
1781f74
Update README: add DOI (#2286)
arkid15r Feb 11, 2025
4d07367
Update pre-commit hooks (#2287)
github-actions[bot] Feb 11, 2025
d55c5b4
Implement HolidayBase::get_closest_holiday functionality (#2211)
Rosi2143 Feb 11, 2025
b84e2df
Update Greenland holidays l10n (#2288)
KJhellico Feb 11, 2025
cd5b56e
Bump coverage from 7.6.10 to 7.6.12 (#2290)
dependabot[bot] Feb 12, 2025
39c8fe9
Bump ruff from 0.9.4 to 0.9.6 (#2291)
dependabot[bot] Feb 12, 2025
d823dd1
Bump lingva from 5.0.4 to 5.0.5 (#2292)
dependabot[bot] Feb 12, 2025
07916a4
Update Hong Kong holidays: fix `th` l10n typo (#2293)
PPsyrius Feb 13, 2025
8d2524b
Add Python syntax check with ruff-pyupgrade rules (#2294)
KJhellico Feb 13, 2025
d2345f9
Unify certain holidays names translation (#2285)
KJhellico Feb 14, 2025
9488f6e
chore: Update snapshots (#2296)
github-actions[bot] Feb 14, 2025
31c3cba
Add Tuvalu holidays (#2295)
Prateekshit73 Feb 17, 2025
2dc766e
Update subdivision names for Presidents' Day in the United States (#2…
parkerbxyz Feb 17, 2025
a662ad9
Finalize v0.67
KJhellico Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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