Skip to main content

Korean Lunar Calendar

Project description

korean_lunar_calendar_py


한국 양음력 변환

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)

한국 양음력 변환 (한국천문연구원 기준) - 네트워크 연결 불필요

음력 변환은 1000년 01월 01일 부터 2050년 11월 18일까지 지원

양력 변환은 1000년 02월 13일 부터 2050년 12월 31일까지 지원

Gregorian calendar (1000-02-13 ~ 2050-12-31) <--> Korean lunar-calendar (1000-01-01 ~ 2050-11-18)

Install


pip install korean_lunar_calendar

To use


  1. import module

    from korean_lunar_calendar import KoreanLunarCalendar
  2. 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

정유년 병오월 임오일 (윤월)

丁酉年 丙午月 壬午日 (閏月)
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

korean_lunar_calendar-0.3.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

korean_lunar_calendar-0.3.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file korean_lunar_calendar-0.3.1.tar.gz.

File metadata

  • Download URL: korean_lunar_calendar-0.3.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.7

File hashes

Hashes for korean_lunar_calendar-0.3.1.tar.gz
Algorithm Hash digest
SHA256 eb2c485124a061016926bdea6d89efdf9b9fdbf16db55895b6cf1e5bec17b857
MD5 535f447d126a69b0b1d08987219fa012
BLAKE2b-256 5a93a0bd2bd53ab19330e83ecc5652b7774ae86fd2fee19bc05ad220cf9db08b

See more details on using hashes here.

File details

Details for the file korean_lunar_calendar-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for korean_lunar_calendar-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 392757135c492c4f42a604e6038042953c35c6f449dda5f27e3f86a7f9c943e5
MD5 96c3be40482dcd926cbf2a88f4949bc9
BLAKE2b-256 9c9630f3fe51b336bb6da4714f4fdad7bbdce8f13af79af2eb75e22908f3f9f4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page