Korean Lunar Calendar
Project description
한국 양음력 변환
Overview
Here is a library to convert Korean lunar-calendar to Gregorian calendar.
Korean calendar and Chinese calendar is same lunar calendar but have different date.
This follow the KARI(Korea Astronomy and Space Science Institute)
한국 양음력 변환 (한국천문연구원 기준) - 네트워크 연결 불필요
음력 변환은 1391년 1월 1일 부터 2050년 11월 18일까지 지원
Gregorian calendar (1391. 2. 5. ~ 2050. 12. 31) <--> Korean lunar-calendar (1391. 1. 1. ~ 2050. 11. 18)
Install
pip install korean_lunar_calendar
To use
import module
from korean_lunar_calendar import KoreanLunarCalendar
Korean Solar Date -> Korean Lunar Date (양력 -> 음력)
calendar = KoreanLunarCalendar() # params : year(년), month(월), day(일) calendar.setSolarDate(2017, 6, 24) # Lunar Date (ISO Format) print(calendar.LunarIsoFormat()) # Korean GapJa String print(calendar.getGapJaString()) # Chinese GapJa String print(calendar.getChineseGapJaString())
[Result] 2017-05-01 Intercalation 정유년 병오월 임오일 (윤월) 丁酉年 丙午月 壬午日 (閏月)
Korean Lunar Date -> Korean Solar Date (음력 -> 양력)
# params : year(년), month(월), day(일), intercalation(윤달여부) calendar.setLunarDate(1956, 1, 21, False) # Solar Date (ISO Format) print(calendar.SolarIsoFormat()) # Korean GapJa String print(calendar.getGapJaString()) # Chinese GapJa String print(calendar.getChineseGapJaString())
[Result] 1956-03-03 병신년 경인월 기사일 丙申年 庚寅月 己巳日
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
File details
Details for the file korean_lunar_calendar-0.1.6.tar.gz
.
File metadata
- Download URL: korean_lunar_calendar-0.1.6.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 99c9c0e84a2cf3d97880c114dd7d44f395db6b3c2167775c9faa1a47def8767f |
|
MD5 | a80ebfa8a1505287f66df137d5805a9b |
|
BLAKE2b-256 | 32bfcb92f94269cba962ae3839e10dbb43ffbea91f92574f0f81674a3baee30e |