Usage Example Notebook¶
[1]:
from kasi import *
[2]:
serviceKey = "..."
[3]:
service = LrsrCldInfoService(serviceKey)
[4]:
service.getLunCalInfo(2015, 1, 1)
[4]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'lunDay': 11,
'lunIljin': '정축(丁丑)',
'lunLeapmonth': '평',
'lunMonth': 11,
'lunNday': 29,
'lunSecha': '갑오(甲午)',
'lunWolgeon': '병자(丙子)',
'lunYear': 2014,
'solDay': '01',
'solJd': 2457024,
'solLeapyear': '평',
'solMonth': '01',
'solWeek': '목',
'solYear': 2015}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[5]:
service.getSolCalInfo(2015, 1, 29)
[5]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'lunDay': 29,
'lunIljin': '갑오(甲午)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': 29,
'lunSecha': '을미(乙未)',
'lunWolgeon': '무인(戊寅)',
'lunYear': 2015,
'solDay': 19,
'solJd': 2457101,
'solLeapyear': '평',
'solMonth': '03',
'solWeek': '목',
'solYear': 2015}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[6]:
service.getSpcifyLunCalInfo(2000, 2016, 1, 1, "평")
[6]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': [{'lunDay': '01',
'lunIljin': '계사(癸巳)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '경진(庚辰)',
'lunWolgeon': '무인(戊寅)',
'lunYear': 2000,
'solDay': '05',
'solJd': 2451580,
'solLeapyear': '윤',
'solMonth': '02',
'solWeek': '토',
'solYear': 2000},
{'lunDay': '01',
'lunIljin': '정해(丁亥)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '신사(辛巳)',
'lunWolgeon': '경인(庚寅)',
'lunYear': 2001,
'solDay': 24,
'solJd': 2451934,
'solLeapyear': '평',
'solMonth': '01',
'solWeek': '수',
'solYear': 2001},
{'lunDay': '01',
'lunIljin': '신해(辛亥)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '임오(壬午)',
'lunWolgeon': '임인(壬寅)',
'lunYear': 2002,
'solDay': 12,
'solJd': 2452318,
'solLeapyear': '평',
'solMonth': '02',
'solWeek': '화',
'solYear': 2002},
{'lunDay': '01',
'lunIljin': '을사(乙巳)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '계미(癸未)',
'lunWolgeon': '갑인(甲寅)',
'lunYear': 2003,
'solDay': '01',
'solJd': 2452672,
'solLeapyear': '평',
'solMonth': '02',
'solWeek': '토',
'solYear': 2003},
{'lunDay': '01',
'lunIljin': '경자(庚子)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '갑신(甲申)',
'lunWolgeon': '병인(丙寅)',
'lunYear': 2004,
'solDay': 22,
'solJd': 2453027,
'solLeapyear': '윤',
'solMonth': '01',
'solWeek': '목',
'solYear': 2004},
{'lunDay': '01',
'lunIljin': '갑자(甲子)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '을유(乙酉)',
'lunWolgeon': '무인(戊寅)',
'lunYear': 2005,
'solDay': '09',
'solJd': 2453411,
'solLeapyear': '평',
'solMonth': '02',
'solWeek': '수',
'solYear': 2005},
{'lunDay': '01',
'lunIljin': '무오(戊午)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '병술(丙戌)',
'lunWolgeon': '경인(庚寅)',
'lunYear': 2006,
'solDay': 29,
'solJd': 2453765,
'solLeapyear': '평',
'solMonth': '01',
'solWeek': '일',
'solYear': 2006},
{'lunDay': '01',
'lunIljin': '계미(癸未)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '정해(丁亥)',
'lunWolgeon': '임인(壬寅)',
'lunYear': 2007,
'solDay': 18,
'solJd': 2454150,
'solLeapyear': '평',
'solMonth': '02',
'solWeek': '일',
'solYear': 2007},
{'lunDay': '01',
'lunIljin': '정축(丁丑)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '무자(戊子)',
'lunWolgeon': '갑인(甲寅)',
'lunYear': 2008,
'solDay': '07',
'solJd': 2454504,
'solLeapyear': '윤',
'solMonth': '02',
'solWeek': '목',
'solYear': 2008},
{'lunDay': '01',
'lunIljin': '신미(辛未)',
'lunLeapmonth': '평',
'lunMonth': '01',
'lunNday': '01',
'lunSecha': '기축(己丑)',
'lunWolgeon': '병인(丙寅)',
'lunYear': 2009,
'solDay': 26,
'solJd': 2454858,
'solLeapyear': '평',
'solMonth': '01',
'solWeek': '월',
'solYear': 2009}]},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 17}}}
[7]:
service.getJulDayInfo(2457024)
[7]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'lunDay': 11,
'lunIljin': '정축(丁丑)',
'lunLeapmonth': '평',
'lunMonth': 11,
'lunNday': 29,
'lunSecha': '갑오(甲午)',
'lunWolgeon': '병자(丙子)',
'lunYear': 2014,
'solDay': '01',
'solJd': 2457024,
'solLeapyear': '평',
'solMonth': '01',
'solWeek': '목',
'solYear': 2015}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[8]:
service = RiseSetInfoService(serviceKey)
[9]:
service.getAreaRiseSetInfo("20150101", "서울")
[9]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'aste': '1858 ',
'astm': '0613 ',
'civile': '1753 ',
'civilm': '0718 ',
'latitude': 3733,
'latitudeNum': '37.5500000',
'location': '서울 ',
'locdate': 20150101,
'longitude': 12658,
'longitudeNum': '126.9666660',
'moonrise': '1429 ',
'moonset': '0341 ',
'moontransit': 213246,
'naute': '1826 ',
'nautm': '0645 ',
'sunrise': '0747 ',
'sunset': '1724 ',
'suntransit': 123519}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[10]:
service.getLCRiseSetInfo("20150101", 128.2, 37.15)
[10]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'aste': '1853 ',
'astm': '0608 ',
'civile': '1749 ',
'civilm': '0712 ',
'latitude': 3709,
'latitudeNum': '37.1500000',
'location': '제천 ',
'locdate': 20150101,
'longitude': 12812,
'longitudeNum': '128.2000000',
'moonrise': '1425 ',
'moonset': '0335 ',
'moontransit': 212744,
'naute': '1822 ',
'nautm': '0639 ',
'sunrise': '0741 ',
'sunset': '1720 ',
'suntransit': 123027}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[11]:
service = SrAltudeInfoService(serviceKey)
[12]:
service.getAreaSrAltudeInfo("20150101", "서울")
[12]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'altitudeMeridian': '29˚ 24´',
'altitude_09': '11˚ 04´',
'altitude_12': '28˚ 50´',
'altitude_15': '20˚ 31´',
'altitude_18': '-07˚ 14´',
'azimuth_09': '130˚ 49´',
'azimuth_12': '170˚ 43´',
'azimuth_15': '215˚ 26´',
'azimuth_18': '246˚ 27´',
'latitude': 3733,
'latitudeNum': '37.5500000',
'location': '서울',
'locdate': 20150101,
'longitude': 12658,
'longitudeNum': '126.9666660'}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[13]:
service.getLCSrAltudeInfo("20150101", 128.2, 37.15)
[13]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'altitudeMeridian': '29˚ 24´',
'altitude_09': '11˚ 04´',
'altitude_12': '28˚ 50´',
'altitude_15': '20˚ 31´',
'altitude_18': '-07˚ 14´',
'azimuth_09': '130˚ 49´',
'azimuth_12': '170˚ 43´',
'azimuth_15': '215˚ 26´',
'azimuth_18': '246˚ 27´',
'latitude': 3733,
'latitudeNum': '37.5500000',
'location': '서울',
'locdate': 20150101,
'longitude': 12658,
'longitudeNum': '126.9666660'}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[14]:
service = SpcdeInfoService(serviceKey)
[15]:
service.getHoliDeInfo(2015, 3)
[15]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'dateKind': '01',
'dateName': '삼일절',
'isHoliday': 'Y',
'locdate': 20150301,
'seq': 1}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[16]:
service.getRestDeInfo(2015, 3)
[16]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'dateKind': '01',
'dateName': '삼일절',
'isHoliday': 'Y',
'locdate': 20150301,
'seq': 1}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[17]:
service.get24DivisionsInfo(2015, 5)
[17]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': [{'dateKind': '03',
'dateName': '입하',
'isHoliday': 'N',
'kst': '0452 ',
'locdate': 20150506,
'seq': 1,
'sunLongitude': 45},
{'dateKind': '03',
'dateName': '소만',
'isHoliday': 'N',
'kst': '1745 ',
'locdate': 20150521,
'seq': 2,
'sunLongitude': 60}]},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 2}}}
[18]:
service.getSundryDayInfo(2015, 1)
[18]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'dateKind': '04',
'dateName': '토왕용사',
'isHoliday': 'N',
'kst': '2002 ',
'locdate': 20150117,
'seq': 1,
'sunLongitude': 297}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[19]:
service = LunPhInfoService(serviceKey)
[20]:
service.getLunPhInfo(2015, 1, 1)
[20]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': {'lunAge': 10.4,
'solDay': '01',
'solMonth': '01',
'solWeek': '목',
'solYear': 2015}},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 1}}}
[21]:
service = AstroEventInfoService(serviceKey)
[22]:
service.getAstroEventInfo(2015, 1)
[22]:
{'response': {'header': {'resultCode': '00', 'resultMsg': 'NORMAL SERVICE.'},
'body': {'items': {'item': [{'astroEvent': '거대마젤란망원경(Giant Magellan Telescope)은 한국, 미국, 호주 등이 공동으로 개발하는 세계 최대 광학망원경이다. 주경 전체 지름은 25.4m로 지름 8.4m인 조각 거울 7장으로 구성된다. 주경에 반사된 별빛은 위쪽의 부경 7장에서 다시 반사되어 주경 가운데 거울의 구멍 속으로 들어오고, 구멍 속으로 들어온 별빛은 관측기기를 통해 컴퓨터로 분석된다. 거대마젤란망원경은 허블 우주망원경보다 10배 더 선명한 영상을 제공할 수 있으며, 별과 행성의 형성, 은하의 형성과 진화, 블랙홀, 암흑물질과 암흑에너지, 우주 최초의 별과 은하 등의 연구에 사용된다. 이 망원경은 지구에서 우주를 관측하기에 가장 좋은 지역인 남반구 칠레의 라스 캄파나스 천문대에 2019년 완공될 예정이다.',
'astroTime': '',
'astroTitle': '대형광학망원경 개발 및 은하진화 연구',
'locdate': '201501 ',
'seq': 1},
{'astroEvent': '지구 근일점(0.983290A.U.)',
'astroTime': '16:00',
'astroTitle': '',
'locdate': 20150104,
'seq': 1},
{'astroEvent': '보름(망), 달 크기 15′03″',
'astroTime': '13:53',
'astroTitle': '',
'locdate': 20150105,
'seq': 1},
{'astroEvent': 'G.갈릴레이 - 목성의 4대위성 발견(1610)',
'astroTitle': '',
'locdate': 20150107,
'seq': 1},
{'astroEvent': '달 원지점 405,408km',
'astroTime': '03:00',
'astroTitle': '',
'locdate': 20150110,
'seq': 1},
{'astroEvent': '수성 - 금성 최대근접(0°39′)',
'astroTime': '10:00',
'astroTitle': '',
'locdate': 20150111,
'seq': 1},
{'astroEvent': '하현',
'astroTime': '18:46',
'astroTitle': '',
'locdate': 20150113,
'seq': 1},
{'astroEvent': '수성 동방최대이각(18°54′)',
'astroTime': '06:00',
'astroTitle': '',
'locdate': 20150115,
'seq': 1},
{'astroEvent': '화성 - 해왕성 최대근접(0°14′)',
'astroTime': '06:00',
'astroTitle': '',
'locdate': 20150120,
'seq': 1},
{'astroEvent': '합삭',
'astroTime': '22:15',
'astroTitle': '',
'locdate': 20150120,
'seq': 2}]},
'numOfRows': 10,
'pageNo': 1,
'totalCount': 16}}}
[ ]: