Korean public holidays calculator — lunar calendar auto-conversion, substitute holidays
Project description
korean-holidays
Korean public holidays calculator with automatic lunar calendar conversion
A Python library that automatically calculates Korean public holidays. Includes automatic lunar-to-solar conversion for Seollal (설날), Chuseok (추석), and Buddha's Birthday (부처님오신날), plus substitute holiday rules. No hardcoding — works for any year.
Features
- Automatic lunar conversion — Seollal (설날), Chuseok (추석), and Buddha's Birthday (부처님오신날) calculated automatically each year
- Automatic substitute holidays — Reflects the expanded 2021 substitute holiday rules
- Any year supported — No hardcoding, just call
get_holidays(2030) - Trading day calculation —
is_trading_day(),count_trading_days() - Built-in cache — No recomputation on repeated calls for the same year
- Zero config — No API key required, no network required
Installation
pip install korean-holidays
Quick Start
from datetime import date
from korean_holidays import get_holidays, is_holiday, is_trading_day, count_trading_days
# All public holidays for 2026
holidays = get_holidays(2026)
for d, name in sorted(holidays.items()):
print(f"{d} {name}")
# Check a specific date
print(is_holiday(date(2026, 2, 17))) # True (Seollal)
print(is_holiday(date(2026, 5, 25))) # True (Buddha's Birthday substitute holiday)
print(is_trading_day(date(2026, 4, 6))) # True (Monday, weekday)
# Number of trading days in a year
days = count_trading_days(date(2026, 1, 1), date(2026, 12, 31))
print(f"Trading days in 2026: {days}")
# Works for 2030 too (not hardcoded)
holidays_2030 = get_holidays(2030)
API Reference
| Function | Description |
|---|---|
get_holidays(year) |
Returns all public holidays for the given year as {date: name} |
is_holiday(date) |
Returns whether the date is a public holiday |
get_holiday_name(date) |
Returns the holiday name, or None if not a holiday |
is_trading_day(date) |
Returns whether the date is a stock market trading day (excludes weekends + holidays) |
get_trading_days(start, end) |
Returns a list of trading days in the date range |
count_trading_days(start, end) |
Returns the number of trading days in the date range |
Supported Holidays
Fixed holidays: New Year's Day (신정), Independence Movement Day (삼일절), Labor Day (근로자의날), Children's Day (어린이날), Memorial Day (현충일), Liberation Day (광복절), National Foundation Day (개천절), Hangul Day (한글날), Christmas
Lunar holidays (automatically calculated): Seollal (설날) 3-day holiday, Chuseok (추석) 3-day holiday, Buddha's Birthday (부처님오신날)
Substitute holidays (automatically applied):
- Seollal (설날) / Chuseok (추석): If overlapping with Sunday, the next available weekday after the holiday period
- Children's Day (어린이날): If overlapping with Saturday/Sunday (since 2014)
- Independence Movement Day (삼일절) / Liberation Day (광복절) / National Foundation Day (개천절) / Hangul Day (한글날): If overlapping with Saturday/Sunday (since 2021)
- Buddha's Birthday (부처님오신날): If overlapping with Saturday/Sunday (since 2023)
Disclaimer
Holiday calculations are based on current legislation and may require updates if laws are amended. Ad-hoc public holidays (e.g., election days) are not included.
License
MIT License. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file korean_holidays-0.3.0.tar.gz.
File metadata
- Download URL: korean_holidays-0.3.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
004a926ab14677dec860d7bbb5035fe1c1e59063c9ea05c0969c0a806e84e2ed
|
|
| MD5 |
6a3583a1165931bad32d2d07d1572b3c
|
|
| BLAKE2b-256 |
fe77bc940f05c7c783e83c95ca16bb423abb83cc1f7a37c86f33d1f8b1fda1e2
|
File details
Details for the file korean_holidays-0.3.0-py3-none-any.whl.
File metadata
- Download URL: korean_holidays-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb117bcbd7779b8c16b29b418d2b443532a95098f7430db1e3cb49eb1272975a
|
|
| MD5 |
edba1adfeba50b23eef4682363caef32
|
|
| BLAKE2b-256 |
aaac18e050b019db281b257e420a53a890e5ee3d312ba931a614d25006f0b1f4
|