예제 #1
0
 def __init__(self):
     self.current_data_json = get_json(config.data_json_filename)
     # self.patients_file = get_xlsx(config.patients_xlsx, "patients.xlsx")
     self.patients_and_inspections_file = get_xlsx(
         config.patients_and_inspections_xlsx, "patients_and_inspections.xlsx"
     )
     # self.patients_sheet = self.patients_file["Sheet1"]
     # self.inspections_file = get_xlsx(config.inspections_xlsx, "inspections.xlsx")
     # self.inspections_sheet = self.inspections_file["モトデータ"]
     # self.main_summary_sheet = self.inspections_file["総括表"]
     self.patients_sheet = self.patients_and_inspections_file["【公開OK】府HP用(陽性者ベース)"]
     self.inspections_sheet = self.patients_and_inspections_file["【公開OK】コロナサイト用(日付ベース)"]
     self.main_summary_sheet = self.patients_and_inspections_file["【公開OK】ピポット集計"]
     self.contacts1_file = get_xlsx(config.contacts1_xlsx, "contacts1.xlsx")
     self.contacts1_sheet = self.contacts1_file["Sheet1"]
     self.contacts2_file = get_xlsx(config.contacts2_xlsx, "contacts2.xlsx")
     self.contacts2_sheet = self.contacts2_file["Sheet1"]
     self.patients_count = 3
     self.inspections_count = 3
     self.contacts1_count = 3
     self.contacts2_count = 4
     self._data_json = {}
     self._patients_json = {}
     self._patients_summary_json = {}
     self._inspections_summary_json = {}
     self._contacts1_summary_json = {}
     self._contacts2_summary_json = {}
     self._treated_summary_json = {}
     self._main_summary_json = {}
     self.last_update = datetime.today().astimezone(jst).strftime("%Y/%m/%d %H:%M")
     self.get_patients()
     self.get_inspections()
     self.get_contacts1()
     self.get_contacts2()
예제 #2
0
 def __init__(self):
     self.contacts_sheet = get_xlsx(config.main_page, 1)["相談件数"]
     self.patients_html = requests_html("/a57337/kenko/health/corona_zokusei.html")
     # self.inspections_sheet = get_xlsx(config.inspections_xlsx, "inspections.xlsx")["検査件数・陽性患者"]
     self.main_summary_html = requests_html("/a73576/kenko/health/infection/protection/covid_19.html")
     self.summary_xlsx = get_xlsx(config.main_page)
     self.main_summary_sheet = self.summary_xlsx["kobe"]
     # 神戸市のサイト形式変更に伴い、self.summary_xlsxに"all"シートが追加され、これが使えるようになるので、
     # allが取得できるようになり次第、自動で切り替えるようにする
     self.all_summary_sheet = None
     try:
         self.all_summary_sheet = self.summary_xlsx["all"]
     except Exception:
         pass
     # self.inspections_count = 4
     self.contacts_count = contacts_first_cell
     self.summary_count = summary_first_cell
     self.all_summary_count = all_summary_first_cell
     self.main_summary_values = []
     self.last_update = datetime.today().astimezone(jst).strftime("%Y/%m/%d %H:%M")
     self._data_json = {}
     # 以下内部変数
     self._contacts_summary_json = {}
     self._health_center_summary_json = {}
     self._patients_json = {}
     self._patients_summary_json = {}
     self._inspections_summary_json = {}
     self._main_summary_json = {}
     # 初期化
     # self.get_inspections()
     self.get_contacts()
     self.get_summary_count()
     self.get_all_summary_count()