-
-
Notifications
You must be signed in to change notification settings - Fork 558
Add North Korea holidays #2911
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
Merged
Merged
Add North Korea holidays #2911
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
63ab05a
Initial commit
Wasif-Shahzad d3e61b6
Merge remote-tracking branch 'upstream/dev' into north-korea-holidays
Wasif-Shahzad b276623
Update country count
Wasif-Shahzad 2eebed7
Reformat references, fix a typo in tests
Wasif-Shahzad ed6295f
commit to merge upstream
Wasif-Shahzad af7b81c
Merge remote-tracking branch 'upstream/dev' into north-korea-holidays
Wasif-Shahzad 9e911d5
commit for merging dev
Wasif-Shahzad aa11fd0
Merge remote-tracking branch 'upstream/dev' into north-korea-holidays
Wasif-Shahzad b96053f
Add Hanshi festival and remove Dano post 1988
Wasif-Shahzad 1f071c8
Correct Hanshi Festival's ko name
Wasif-Shahzad 7561fd8
Update tests and references
Wasif-Shahzad ed29524
Merge remote-tracking branch 'upstream/dev' into north-korea-holidays
Wasif-Shahzad fa38ab8
Update country count
Wasif-Shahzad f90af44
Add review suggestions
Wasif-Shahzad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
# 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: Vacanza Team and individual contributors (see CONTRIBUTORS file) | ||
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | ||
# ryanss <ryanssdev@icloud.com> (c) 2014-2017 | ||
# Website: https://github.com/vacanza/holidays | ||
# License: MIT (see LICENSE file) | ||
|
||
from gettext import gettext as tr | ||
|
||
from holidays.calendars.chinese import KOREAN_CALENDAR | ||
from holidays.groups import ChineseCalendarHolidays, InternationalHolidays | ||
from holidays.holiday_base import HolidayBase | ||
|
||
|
||
class NorthKorea(HolidayBase, ChineseCalendarHolidays, InternationalHolidays): | ||
"""North Korea holidays. | ||
|
||
References: | ||
* <https://en.wikipedia.org/wiki/Public_holidays_in_North_Korea> | ||
* <https://en.wikipedia.org/wiki/Day_of_Songun> | ||
* <https://en.wikipedia.org/wiki/Dano_(festival)> | ||
* <https://en.wikipedia.org/wiki/Cold_Food_Festival> | ||
* <https://ko.wikipedia.org/wiki/조국해방전쟁_승리_기념일> | ||
* [2025 Holidays](https://namu.wiki/w/공휴일/북한) | ||
* [Korean People's Army](https://web.archive.org/web/20250824194534/https://namu.wiki/w/조선인민군) | ||
* [Founding Day of the Korean People's Revolutionary Army](https://web.archive.org/web/20250909074255/https://www.nocutnews.co.kr/news/1091995) | ||
* [Holidays and Anniversaries](http://archive.today/2025.09.21-064344/https://unikorea.go.kr/nkhr/current/life/living/daily/?boardId=bbs_0000000000000078&mode=view&cntId=51400) | ||
* [Day of Songun](http://archive.today/2025.09.21-063344/https://namu.wiki/w/선군절) | ||
* [2013 North Korea Calendar](https://web.archive.org/web/20250921062305/https://nk.chosun.com/news/articleView.html?idxno=151905) | ||
* [Daeboreum in North Korea](https://web.archive.org/web/20230210091341/https://www.newsis.com/view/?id=NISX20200207_0000911479) | ||
* [Day of the Shining Star](https://web.archive.org/web/20250921063234/https://www.munhwa.com/article/11412228) | ||
* [Day of the Sun](http://archive.today/2025.09.21-063705/https://namu.wiki/w/태양절) | ||
* [Cheongmyeong Festival](https://web.archive.org/web/20250324201145/https://namu.wiki/w/청명) | ||
""" | ||
|
||
country = "KP" | ||
default_language = "ko_KP" | ||
# %s (estimated). | ||
estimated_label = tr("%s (추정된)") | ||
start_year = 1948 | ||
supported_languages = ("en_US", "ko_KP") | ||
|
||
def __init__(self, *args, **kwargs): | ||
ChineseCalendarHolidays.__init__(self, calendar=KOREAN_CALENDAR) | ||
InternationalHolidays.__init__(self) | ||
super().__init__(*args, **kwargs) | ||
|
||
def _populate_public_holidays(self): | ||
# New Year's Day. | ||
self._add_new_years_day(tr("양력설")) | ||
|
||
if self._year <= 1967 or self._year >= 1989: | ||
# Korean New Year. | ||
self._add_chinese_new_years_day(tr("설명절")) | ||
|
||
if self._year >= 2003: | ||
# Daeboreum. | ||
self._add_daeboreum_day(tr("대보름")) | ||
|
||
if self._year <= 1977 or self._year >= 2018: | ||
# Founding Day of the Korean People's Army. | ||
self._add_holiday_feb_8(tr("조선인민군창건일")) | ||
|
||
if self._year >= 1975: | ||
name = ( | ||
# Day of the Shining Star. | ||
tr("광명성절") | ||
if self._year >= 2012 | ||
# Kim Jong Il's Birthday. | ||
else tr("김정일의 생일") | ||
) | ||
self._add_holiday_feb_16(name) | ||
if self._year >= 1986: | ||
self._add_holiday_feb_17(name) | ||
|
||
# International Women's Day. | ||
self._add_womens_day(tr("국제부녀절")) | ||
|
||
if self._year >= 2012: | ||
# Cheongmyeong Festival. | ||
self._add_qingming_festival(tr("청명")) | ||
|
||
if self._year <= 1967: | ||
# Hanshi Festival. | ||
self._add_hanshi_festival(tr("한식")) | ||
|
||
if self._year == 1962 or self._year >= 1968: | ||
name = ( | ||
# Day of the Sun. | ||
tr("태양절") | ||
if self._year >= 1998 | ||
# Kim Il-Sung's Birthday. | ||
else tr("김일성의 생일") | ||
) | ||
self._add_holiday_apr_15(name) | ||
if self._year >= 1998: | ||
self._add_holiday_apr_16(name) | ||
|
||
if self._year >= 1978: | ||
self._add_holiday_apr_25( | ||
# Founding Day of the Korean People's Revolutionary Army. | ||
tr("조선인민혁명군 창건일") | ||
if self._year >= 2018 | ||
# Armed Forces Day. | ||
else tr("건군절") | ||
) | ||
|
||
# International Workers' Day. | ||
self._add_labor_day(tr("전세계근로자들의 국제적명절")) | ||
|
||
if self._year <= 1967: | ||
# Dano. | ||
self._add_dragon_boat_festival(tr("단오")) | ||
|
||
# Foundation Day of the Korean Children's Union. | ||
self._add_holiday_jun_6(tr("조선소년단 창립절")) | ||
|
||
if self._year >= 1996: | ||
# Day of Victory in the Great Fatherland Liberation War. | ||
self._add_holiday_jul_27(tr("조국해방전쟁승리기념일")) | ||
|
||
# Liberation Day. | ||
self._add_holiday_aug_15(tr("조국해방절")) | ||
|
||
if self._year <= 1966 or self._year >= 1989: | ||
# Chuseok. | ||
self._add_mid_autumn_festival(tr("추석")) | ||
|
||
if self._year >= 2013: | ||
# Day of Songun. | ||
self._add_holiday_aug_25(tr("선군절")) | ||
|
||
# Youth Day. | ||
self._add_holiday_aug_28(tr("청년절")) | ||
|
||
# Founding Day of the DPRK. | ||
self._add_holiday_sep_9(tr("조선민주주의인민공화국창건일")) | ||
|
||
# Foundation Day of the Workers' Party of Korea. | ||
self._add_holiday_oct_10(tr("조선로동당창건일")) | ||
|
||
if self._year >= 2012: | ||
# Mother's Day. | ||
self._add_holiday_nov_16(tr("어머니날")) | ||
|
||
if self._year >= 1972: | ||
# Socialist Constitution Day. | ||
self._add_holiday_dec_27(tr("사회주의헌법절")) | ||
|
||
|
||
class KP(NorthKorea): | ||
pass | ||
|
||
|
||
class PRK(NorthKorea): | ||
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
# 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: Vacanza Team and individual contributors (see CONTRIBUTORS file) | ||
# dr-prodigy <dr.prodigy.github@gmail.com> (c) 2017-2023 | ||
# ryanss <ryanssdev@icloud.com> (c) 2014-2017 | ||
# Website: https://github.com/vacanza/holidays | ||
# License: MIT (see LICENSE file) | ||
# | ||
# North Korea holidays en_US localization. | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Holidays 0.82\n" | ||
"POT-Creation-Date: 2025-09-07 18:20+0500\n" | ||
"PO-Revision-Date: 2025-09-07 18:20+0500\n" | ||
"Last-Translator: Wasif Shahzad <wasif_shahzad_1@outlook.com>\n" | ||
"Language-Team: Holidays Localization Team\n" | ||
"Language: en_US\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"Generated-By: Lingva 5.0.6\n" | ||
"X-Source-Language: ko_KP\n" | ||
|
||
#. %s (estimated). | ||
#, c-format | ||
msgid "%s (추정된)" | ||
msgstr "%s (estimated)" | ||
|
||
#. New Year's Day. | ||
msgid "양력설" | ||
msgstr "New Year's Day" | ||
|
||
#. Korean New Year. | ||
msgid "설명절" | ||
msgstr "Korean New Year" | ||
|
||
#. Daeboreum. | ||
msgid "대보름" | ||
msgstr "Daeboreum" | ||
|
||
#. Founding Day of the Korean People's Army. | ||
msgid "조선인민군창건일" | ||
msgstr "Founding Day of the Korean People's Army" | ||
|
||
#. Day of the Shining Star. | ||
msgid "광명성절" | ||
msgstr "Day of the Shining Star" | ||
|
||
#. Kim Jong Il's Birthday. | ||
msgid "김정일의 생일" | ||
msgstr "Kim Jong Il's Birthday" | ||
|
||
#. International Women's Day. | ||
msgid "국제부녀절" | ||
msgstr "International Women's Day" | ||
|
||
#. Cheongmyeong Festival. | ||
msgid "청명" | ||
msgstr "Cheongmyeong Festival" | ||
|
||
#. Hanshi Festival. | ||
msgid "한식" | ||
msgstr "Hanshi Festival" | ||
|
||
#. Day of the Sun. | ||
msgid "태양절" | ||
msgstr "Day of the Sun" | ||
|
||
#. Kim Il-Sung's Birthday. | ||
msgid "김일성의 생일" | ||
msgstr "Kim Il-Sung's Birthday" | ||
|
||
#. Founding Day of the Korean People's Revolutionary Army. | ||
msgid "조선인민혁명군 창건일" | ||
msgstr "Founding Day of the Korean People's Revolutionary Army" | ||
|
||
#. Armed Forces Day. | ||
msgid "건군절" | ||
msgstr "Armed Forces Day" | ||
|
||
#. International Workers' Day. | ||
msgid "전세계근로자들의 국제적명절" | ||
msgstr "International Workers' Day" | ||
|
||
#. Dano. | ||
msgid "단오" | ||
msgstr "Dano" | ||
|
||
#. Foundation Day of the Korean Children's Union. | ||
msgid "조선소년단 창립절" | ||
msgstr "Foundation Day of the Korean Children's Union" | ||
|
||
#. Day of Victory in the Great Fatherland Liberation War. | ||
msgid "조국해방전쟁승리기념일" | ||
msgstr "Day of Victory in the Great Fatherland Liberation War" | ||
|
||
#. Liberation Day. | ||
msgid "조국해방절" | ||
msgstr "Liberation Day" | ||
|
||
#. Chuseok. | ||
msgid "추석" | ||
msgstr "Chuseok" | ||
|
||
#. Day of Songun. | ||
msgid "선군절" | ||
msgstr "Day of Songun" | ||
|
||
#. Youth Day. | ||
msgid "청년절" | ||
msgstr "Youth Day" | ||
|
||
#. Founding Day of the DPRK. | ||
msgid "조선민주주의인민공화국창건일" | ||
msgstr "Founding Day of the DPRK" | ||
|
||
#. Foundation Day of the Workers' Party of Korea. | ||
msgid "조선로동당창건일" | ||
msgstr "Foundation Day of the Workers' Party of Korea" | ||
|
||
#. Mother's Day. | ||
msgid "어머니날" | ||
msgstr "Mother's Day" | ||
|
||
#. Socialist Constitution Day. | ||
msgid "사회주의헌법절" | ||
msgstr "Socialist Constitution Day" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.