Skip to content

Commit

Permalink
Merge pull request #1377 from dr-prodigy/beta
Browse files Browse the repository at this point in the history
v.0.29
  • Loading branch information
arkid15r authored Jul 17, 2023
2 parents bf54bcd + 709f71f commit 78cbdf4
Show file tree
Hide file tree
Showing 269 changed files with 5,642 additions and 4,662 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
name: dist
path: dist
- name: Publish Package
uses: pypa/[email protected].7
uses: pypa/[email protected].8
with:
user: __token__
password: ${{ secrets.pypi_password }}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black
exclude: ^(docs)
Expand Down Expand Up @@ -61,7 +61,7 @@ repos:
- id: tox-ini-fmt

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.3.0
rev: v2.4.0
hooks:
- id: setup-cfg-fmt

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.29
============

Released July 17, 2023

- Refactor movable holidays (#1357 by @KJhellico)
- Add Guatemala holidays (#1364 by @aztrock)
- Add Arabic localization (#1341 by @abh31000)
- Optimize .po files update process (#1372 by @KJhellico)
- Optimize HolidayBase::get_named() method (#1366 by @KJhellico)
- Update .po files format: remove location comments (#1362 by @KJhellico)
- Update Algeria holidays: add missing file headers (#1363 by @arkid15r, @KJhellico)
- Update Eid-al-Adha 2023 exact dates (#1361 by @KJhellico)
- Update InternationalHolidays group: add May 2 and 3 (#1367 by @KJhellico)
- Update Ireland holidays: finish migration to holiday groups (#1350 by @KJhellico)
- Update United Kingdom holidays: update certain holidays start years (#1353 by @KJhellico)
- Migrate Bangladesh and Russia to holiday groups (#1371 by @KJhellico)
- Migrate Belgium and Luxembourg to holiday groups, add l10n support (#1343 by @KJhellico)
- Migrate Bulgaria holidays to holiday groups and categories (#1351 by @KJhellico)
- Migrate Croatia, Czechia and Slovenia to holiday groups, add l10n support (#1344 by @KJhellico)

Version 0.28
============

Expand Down
32 changes: 18 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,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 130 country codes. The standard way to refer to a country
We currently support 131 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 of the countries support more
than one language for holiday names output.
Expand Down Expand Up @@ -140,7 +140,7 @@ The list of supported countries, their subdivisions and supported languages
* - Algeria
- DZ
-
-
- **ar**, en_US
* - American Samoa
- AS
- Can also be loaded as country US, subdivision AS
Expand Down Expand Up @@ -180,7 +180,7 @@ The list of supported countries, their subdivisions and supported languages
* - Bahrain
- BH
-
-
- **ar**, en_US
* - Bangladesh
- BD
-
Expand All @@ -192,7 +192,7 @@ The list of supported countries, their subdivisions and supported languages
* - Belgium
- BE
-
-
- de, en_US, fr, **nl**, uk
* - Belize
- BZ
-
Expand Down Expand Up @@ -220,7 +220,7 @@ The list of supported countries, their subdivisions and supported languages
* - Bulgaria
- BG
-
- **bg**, en_US
- **bg**, en_US, uk
* - Burkina Faso
- BF
-
Expand Down Expand Up @@ -264,7 +264,7 @@ The list of supported countries, their subdivisions and supported languages
* - Croatia
- HR
-
-
- en_US, **hr**, uk
* - Cuba
- CU
-
Expand All @@ -280,7 +280,7 @@ The list of supported countries, their subdivisions and supported languages
* - Czechia
- CZ
-
-
- **cs**, en_US, uk
* - Denmark
- DK
-
Expand All @@ -300,7 +300,7 @@ The list of supported countries, their subdivisions and supported languages
* - Egypt
- EG
-
-
- **ar**, en_US
* - El Salvador
- SV
- Departments: AH, CA, CH, CU, LI, MO, PA, SA, SM, SO, SS, SV, UN, US
Expand Down Expand Up @@ -345,6 +345,10 @@ The list of supported countries, their subdivisions and supported languages
- GU
- Can also be loaded as country US, subdivision GU
-
* - Guatemala
- GT
-
- en_US, **es**
* - Honduras
- HN
-
Expand Down Expand Up @@ -424,7 +428,7 @@ The list of supported countries, their subdivisions and supported languages
* - Luxembourg
- LU
-
-
- de, en_US, fr, **lb**, uk
* - Madagascar
- MG
-
Expand Down Expand Up @@ -464,7 +468,7 @@ The list of supported countries, their subdivisions and supported languages
* - Morocco
- MA
-
-
- **ar**, en_US
* - Mozambique
- MZ
-
Expand Down Expand Up @@ -548,7 +552,7 @@ The list of supported countries, their subdivisions and supported languages
* - Saudi Arabia
- SA
-
-
- **ar**, en_US
* - Serbia
- RS
-
Expand All @@ -564,7 +568,7 @@ The list of supported countries, their subdivisions and supported languages
* - Slovenia
- SI
-
-
- en_US, **sl**, uk
* - South Africa
- ZA
-
Expand Down Expand Up @@ -596,7 +600,7 @@ The list of supported countries, their subdivisions and supported languages
* - Tunisia
- TN
-
-
- **ar**, en_US
* - Turkey
- TR
-
Expand All @@ -608,7 +612,7 @@ The list of supported countries, their subdivisions and supported languages
* - United Arab Emirates
- AE
-
-
- **ar**, en_US
* - United Kingdom
- GB
- Subdivisions: ENG, NIR, SCT, WLS
Expand Down
2 changes: 1 addition & 1 deletion holidays/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from holidays.registry import EntityLoader
from holidays.utils import *

__version__ = "0.28"
__version__ = "0.29"


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 @@ -64,6 +64,7 @@
from .germany import Germany, DE, DEU
from .greece import Greece, GR, GRC
from .guam import Guam, GU, GUM, HolidaysGU
from .guatemala import Guatemala, GT, GUA
from .honduras import Honduras, HN, HND
from .hongkong import HongKong, HK, HKG
from .hungary import Hungary, HU, HUN
Expand Down
53 changes: 36 additions & 17 deletions holidays/countries/algeria.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <[email protected]> (c) 2017-2023
# ryanss <[email protected]> (c) 2014-2017
# Website: https://github.com/dr-prodigy/python-holidays
# License: MIT (see LICENSE file)

from gettext import gettext as tr

from holidays.calendars.gregorian import JAN, JUL, NOV
from holidays.holiday_base import HolidayBase
from holidays.holiday_groups import IslamicHolidays, InternationalHolidays
Expand All @@ -10,6 +23,10 @@ class Algeria(HolidayBase, InternationalHolidays, IslamicHolidays):
"""

country = "DZ"
default_language = "ar"
# Estimated label.
estimated_label = tr("(تقدير*) *%s")
supported_languages = ("ar", "en_US")

def __init__(self, *args, **kwargs):
InternationalHolidays.__init__(self)
Expand All @@ -20,46 +37,48 @@ def _populate(self, year):
super()._populate(year)

# New Year's Day.
self._add_new_years_day("New Year's Day")
self._add_new_years_day(tr("رأس السنة الميلادية"))

# Amazigh New Year / Yennayer
# In January 2018, Algeria declared Yennayer a national holiday
if year >= 2018:
self._add_holiday("Amazigh New Year", JAN, 12)
# Amazigh New Year / Yennayer
self._add_holiday(tr("رأس السنة الأمازيغية"), JAN, 12)

# Labour Day
self._add_labor_day("Labour Day")
self._add_labor_day(tr("عيد العمال"))

# Independence Day
if year >= 1962:
self._add_holiday("Independence Day", JUL, 5)
# Independence Day
self._add_holiday(tr("عيد الإستقلال"), JUL, 5)

# Revolution Day
if year >= 1963:
self._add_holiday("Revolution Day", NOV, 1)
# Revolution Day
self._add_holiday(tr("عيد الثورة"), NOV, 1)

# Islamic New Year
self._add_islamic_new_year_day("Islamic New Year")
self._add_islamic_new_year_day(tr("رأس السنة الهجرية"))

# Ashura
self._add_ashura_day("Ashura Day")
self._add_ashura_day(tr("عاشورة"))

# Mawlid / Prophet's Birthday
self._add_mawlid_day("Prophet's Birthday")
self._add_mawlid_day(tr("عيد المولد النبوي"))

# As of April 30, 2023. Algeria has 3 days of Eid holidays
# (https://www.horizons.dz/english/archives/amp/12021)
# Eid al-Fitr - Feast Festive
self._add_eid_al_fitr_day("Eid al-Fitr")
self._add_eid_al_fitr_day_two("Eid al-Fitr Holiday")
self._add_eid_al_fitr_day(tr("عيد الفطر"))
# Eid al-Fitr Holiday
self._add_eid_al_fitr_day_two(tr("عطلة عيد الفطر"))
if year >= 2024:
self._add_eid_al_fitr_day_three("Eid al-Fitr Holiday")
self._add_eid_al_fitr_day_three(tr("عطلة عيد الفطر"))

# Eid al-Adha - Scarfice Festive
self._add_eid_al_adha_day("Eid al-Adha")
self._add_eid_al_adha_day_two("Eid al-Adha Holiday")
self._add_eid_al_adha_day(tr("عيد الأضحى"))
# Eid al-Adha Holiday
self._add_eid_al_adha_day_two(tr("عطلة عيد الأضحى"))
if year >= 2023:
self._add_eid_al_adha_day_three("Eid al-Adha Holiday")
self._add_eid_al_adha_day_three(tr("عطلة عيد الأضحى"))


class DZ(Algeria):
Expand Down
Loading

0 comments on commit 78cbdf4

Please sign in to comment.