|
| 1 | +import streamlit as st |
| 2 | +from streamlit_calendar import calendar |
| 3 | + |
| 4 | +class CalendarApp: |
| 5 | + def __init__(self): |
| 6 | + self.calendar_options = { |
| 7 | + "editable": True, |
| 8 | + "selectable": True, |
| 9 | + "headerToolbar": { |
| 10 | + "left": "prev,next today", |
| 11 | + "center": "title", |
| 12 | + "right": "dayGridMonth,listMonth", |
| 13 | + }, |
| 14 | + "initialView": "dayGridMonth", |
| 15 | + } |
| 16 | + |
| 17 | + self.calendar_events = [] |
| 18 | + |
| 19 | + # 색상 설정 |
| 20 | + self.color_map = { |
| 21 | + "발표": "#FF6F61", # 부드러운 주황색 |
| 22 | + "서류 시작": "#4FC3F7", # 밝은 하늘색 |
| 23 | + "서류 마감": "#81C784", # 연한 초록색 |
| 24 | + "시험일": "#BA68C8", # 연한 보라색 |
| 25 | + "발표일": "#9575CD", # 은은한 보라색 |
| 26 | + "면접": "#FFA726", # 오렌지색 |
| 27 | + "시험 접수": "#B0BEC5" # 차분한 회색 |
| 28 | + } |
| 29 | + |
| 30 | + # 캘린더 데이터 |
| 31 | + calendar_data = { |
| 32 | + "12월": { |
| 33 | + "1일": ["하나손해보험 서류 마감"], |
| 34 | + "2일": ["기업은행 면접"], |
| 35 | + "3일": ["국민은행 최종 발표", "신한은행 2차 면접 발표", "국민은행 동계 인턴십 서류 마감"], |
| 36 | + "4일": ["예금보험공사 인턴 서류 발표", "우리자산운용 서류 발표", "신협중앙회 서류 마감", "미래에셋증권 서류 마감"], |
| 37 | + "5일": ["우체국금융개발원 서류 마감", "우리자산운용 1차 면접", "재경관리사 시작", "회계관리 시작", "AT자격시험 시작"], |
| 38 | + "6일": ["농협은행 5급 최종 발표", "농협중앙회 5급 최종 발표", "농협손해보험 최종 발표", "신용보증재단중앙회 1차 면접 발표", "신용보증재단중앙회 1차면접 발표", "매경테스트 발표", "파생상품투자권 발표", "유자문인력 발표", "외환전문역 발표"], |
| 39 | + "7일": ["우리금융캐피탈 필기 시험", "전산세무회계 시험"], |
| 40 | + "8일": [], |
| 41 | + "9일": ["농협은행 6급 최종 발표", "교보증권 인턴 필기 시험", "우체국금융개발원 면접", "경기신용보증재단 서류 마감"], |
| 42 | + "10일": ["한국재정정보원 인턴 최종 발표", "신용보증재단중앙회 인턴 면접 발표", "수협중앙회 2차 면접", "재경관리사 마감", "회계관리 마감"], |
| 43 | + "11일": ["국민은행 동계인턴십 서류 발표", "예금보험공사 인턴 면접", "신용보증재단중앙회 2차 면접", "AT자격시험"], |
| 44 | + "12일": ["국민연금공단 최종 발표", "기업은행 동계인턴 서류 발표"], |
| 45 | + "13일": ["AFPK 발표", "국민은행 동계인턴십 면접"], |
| 46 | + "14일": ["경기신용보증재단 필기 시험"], |
| 47 | + "15일": ["교보증권 인턴 서류 마감"], |
| 48 | + "16일": ["예금보험공사 인턴 면접 발표", "신용보증재단중앙회 최종 발표", "우체국금융개발원 최종 발표", "테셋 마감"], |
| 49 | + "17일": ["유통관리사 2급 발표"], |
| 50 | + "18일": ["우리은행 체험형 인턴 서류 발표", "교보증권 인턴 실무 면접"], |
| 51 | + "19일": ["지역농협 최종 발표","국민은행 동계 인턴십 최종 발표", "펀드투자자문사 인력 발표"], |
| 52 | + "20일": ["수협중앙회 최종 발표"], |
| 53 | + "21일": ["재경관리사 시험", "AT자격 시험", "회계관리 시험"], |
| 54 | + "22일": [], |
| 55 | + "23일": ["우리은행 체험형 인턴 면접"], |
| 56 | + "24일": ["우리자산운용 최종 발표"], |
| 57 | + "25일": [], |
| 58 | + "26일": ["신협중앙회 서류 발표", "전산세무회계 발표"], |
| 59 | + "27일": ["재경관리사 발표", "회계관리 발표"], |
| 60 | + "28일": ["테셋 시험"] |
| 61 | + } |
| 62 | + } |
| 63 | + |
| 64 | + # 이벤트로 변환 |
| 65 | + for day, events in calendar_data["12월"].items(): |
| 66 | + if events: # 이벤트가 있는 경우에만 추가 |
| 67 | + date = f"2024-12-{int(day[:-1]):02d}" # "1일" -> "2024-12-01" |
| 68 | + for event in events: |
| 69 | + category = self.get_event_category(event) |
| 70 | + self.calendar_events.append( |
| 71 | + { |
| 72 | + "title": event, |
| 73 | + "start": date, |
| 74 | + "color": self.color_map[category], |
| 75 | + "category": category |
| 76 | + } |
| 77 | + ) |
| 78 | + |
| 79 | + def get_event_category(self, event): |
| 80 | + """이벤트 제목에 따라 카테고리를 반환""" |
| 81 | + if "발표" in event and "면접" not in event and "서류" not in event: |
| 82 | + return "발표일" |
| 83 | + elif "면접" in event: |
| 84 | + return "면접" |
| 85 | + elif "발표" in event: |
| 86 | + return "발표" |
| 87 | + elif "서류 시작" in event: |
| 88 | + return "서류 시작" |
| 89 | + elif "서류 마감" in event: |
| 90 | + return "서류 마감" |
| 91 | + elif "시험" in event: |
| 92 | + return "시험일" |
| 93 | + else: |
| 94 | + return "시험 접수" |
| 95 | + |
| 96 | + def render(self): |
| 97 | + st.subheader("📅 금융권 채용 & 자격증 캘린더") |
| 98 | + |
| 99 | + # 셀렉트 박스 카테고리 선택 |
| 100 | + categories = [ |
| 101 | + "전체 보기", "발표", "면접", "서류 시작", "서류 마감", |
| 102 | + "시험일", "발표일", "시험 접수" |
| 103 | + ] |
| 104 | + selected_category = st.selectbox("카테고리 선택", categories) |
| 105 | + |
| 106 | + # 필터링된 이벤트 |
| 107 | + if selected_category == "전체 보기": |
| 108 | + filtered_events = self.calendar_events # 모든 이벤트 표시 |
| 109 | + else: |
| 110 | + filtered_events = [ |
| 111 | + event for event in self.calendar_events |
| 112 | + if event["category"] == selected_category |
| 113 | + ] |
| 114 | + |
| 115 | + # 캘린더 출력 |
| 116 | + calendar(events=filtered_events, options=self.calendar_options) |
| 117 | + |
| 118 | +def show(): |
| 119 | + app = CalendarApp() |
| 120 | + app.render() |
| 121 | + |
| 122 | +if __name__ == "__main__": |
| 123 | + show() |
0 commit comments