Skip to content

Commit

Permalink
create csv files from data_files
Browse files Browse the repository at this point in the history
  • Loading branch information
To-Ki-O committed Feb 17, 2024
1 parent 1e36730 commit f58b245
Show file tree
Hide file tree
Showing 49 changed files with 3,522 additions and 12 deletions.
4 changes: 2 additions & 2 deletions action.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import glob


def integrate(input_file_path, output_file_path):
def integrate(input_file_path, output_file_name):
csv_files = glob.glob(f"{input_file_path}/*.csv")
data_list = []

Expand All @@ -11,4 +11,4 @@ def integrate(input_file_path, output_file_path):

df = pd.concat(data_list, axis=0, sort=True)

df.to_csv(f"{output_file_path}/integration_file.csv", index=False)
df.to_csv(f"{output_file_name}", index=False)
22 changes: 12 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
if not os.path.exists("./output_files"):
os.mkdir("./output_files")

dfs = tabula.read_pdf("000876235.pdf", lattice=True, pages='all', pandas_options={'header': None})
i = 0
for df in dfs:
i += 1
df = df.replace('\n', '', regex=True).replace('\r', '', regex=True).replace('\r\n', '', regex=True).replace('\n\r', '', regex=True)
print(df)
df.to_csv(f"./files/{i}.csv", index=None)

integrate("./files", "output_files")

for i in range(1, 47):
opendata_file = os.listdir(f"./data_files/shinryoujo_{i}")
dfs = tabula.read_pdf(f"./data_files/shinryoujo_{i}/{opendata_file[0]}", lattice=True, pages='all', pandas_options={'header': None})
j = 0
for df in dfs:
j += 1
df = df.replace('\n', '', regex=True).replace('\r', '', regex=True).replace('\r\n', '', regex=True).replace('\n\r', '', regex=True)
print(df)
df.to_csv(f"./files/{j}.csv", index=None)
integrate("./files", f"./output_files/output{i}.csv")
shutil.rmtree("./files")
os.mkdir("./files")
shutil.rmtree("./files")
130 changes: 130 additions & 0 deletions output_files/output1.csv

Large diffs are not rendered by default.

59 changes: 59 additions & 0 deletions output_files/output10.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
0,1,2,3,4,5,6,7
基本情報,,,,,,,
施設名,郵便番号,住所,電話番号,ウェブサイトURL,産科、婦人科又は産婦人科の標榜の有無,医療機関における緊急避妊にかかる対面診療への対応可能時間帯,常時の緊急避妊薬の在庫の有無
横田マタニティーホスピタル,371-0031,前橋市下小出町1-5-22,027-219-4103,https://www.yokotamaternity.com/,有,月・火・木・金:9:00-16:30、水・土:9:00-11:30,有
横田レディースクリニック,371-0031,群馬県前橋市下小出町1-16-5,027-289-6116,https://www.yokota-clinic.or.jp/,有,"月・火・木9:00-13:00,14:00-18:00、土9:00-13:00",有
群馬中央病院,371-0025,前橋市紅雲町1-7-13,027-221-8165,https://gunma.jcho.go.jp/,有,原則平日8:00-11:00(24時間対応可能),無(処方箋発行)
中野産婦人科医院,371-0033,前橋市国領町2-2-12,027-233-5588,-,有,平日:9:00-18:00、土:9:00-12:30,有
山王医院,379-2123,前橋市山王町2-20-16,027-266-5410,-,有,月・金:9:00-12:30,有
さくらクリニック,371-0816,前橋市上佐鳥町1203-2,027-212-2434,-,有,"火・水・木:9:00-11:00,15:00-17:00、土・日:9:00-13:00",有
神岡産婦人科医院,371-0841,前橋市石倉町5-22-1,027-253-4152,http://www.kamioka.or.jp/,有,"月・火・水・金:9:00-12:30,15:00-18:00、木・土:9:00-12:30",有
前橋協立病院,371-0811,前橋市朝倉町828-1,027-265-3511,https://www.kyouritsu.or.jp/,有,外来診療時間,有
いとうレディースクリニック,371-0811,前橋市朝倉町867-3,027-290-3531,http://www.ito-ladies.com,有,"平日9:00-13:30,15:00-18:00、土9:00-12:00,14:00-16:00",有
医療法人晴方会いまいウイメンズクリニック,371-0012,前橋市東片貝町875,027-221-1000,http://imai-womens.com/,有,"月・火・水・金:9:00-12:30,15:00-17:30、木・土:9:00-12:30",有
ベルフィーユ今井レディースクリニック,371-0805,前橋市南町四丁目52-13,027-223-3114,http://www.belle-fille.jp/,有,"平日:9:00-12:30,14:30-17:30、土:9:00-12:30",有
さとうレディースクリニック,371-0024,前橋市表町2-20-17,027-224-7606,-,有,"月・火・水・金:10:00-13:30,15:30-19:00、土:10:00-13:30,15:30-17:30",有
道下産婦人科医院,371-0027,前橋市平和町1-7-3,027-231-7821,-,有,"平日:9:00-12:30,14:30-18:00、土:9:00-13:00",有
クリニックオガワ,377-0007,渋川市石原113,0279-22-1377,http://www.ogawa.or.jp/,有,"月・水・金:9:00-12:00、火・木:9:00-12:00,15:00-18:00、土:9:00-12:00,14:00-17:00",有
渋川中央病院,377-0007,渋川市石原508-1,0279-25-1711,http://shibutyu.com/,有,"月・火・水・金:9:00-12:00,15:00-17:30、木・土:9:00-12:00",有
まつい女性クリニック,370-3602,北群馬郡吉岡町大久保751-4,0279-30-6510,http://www.myclinic.ne.jp/matsui_lady/pc/,有,"月・火・水・金:9:00-12:30,15:00-18:30、土:9:00-12:30",有
医療法人福井会フクイ産婦人科クリニック,372-0024,伊勢崎市下植木町553-3,0270-24-7211,http://www.fukuikai.jp/,有,24時間対応,有
医療法人 纉喜会朋友産婦人科クリニック,372-0012,伊勢崎市豊城町2360-2,0270-21-5080,-,有,"月・火・水・金・土:9:00-12:30,14:30-18:00",有
医療法人一灯会新生産婦人科医院,372-0034,伊勢崎市茂呂2-2878ー1,0270-23-1333,https://isesakisawa.gunma.med.or.jp/map/individual/shinsei_san.,tm有,随時受付,有
あかつきウィメンズクリニック,372-0817,伊勢崎市連取本町20-9,0270-21-7000,https://akatsukiwomens.com/,有,月・火・木・金:9:00-18:00、土・日:9:00-12:00,有
宇津木医院,370-1101,佐波郡玉村町藤川198-2,0270-64-7878,https://isesakisawa.gunma.med.or.jp/map/individual/utsugi.htm,有,"月-土:9:00-12:00,15:00-18:00",有
医療法人あいおい会こすもレディースクリニック,370-0052,高崎市旭町113-7 ハートスクエア長建1,027-330-2215,https://www.cosmo-ladies.com/,有,"平日:9:30-13:00,15:00-20:00、水:15:00-20:00、土:9:30-13:00",有
岸産婦人科医院,370-0086,高崎市沖町567,027-343-6412,-,有,"月・水:9:00-12:00,14:00-17:30(※水は9:40-)、火・金:9:00-12:00、土:9:00-12:00,14:00-17:00",有
斎川産婦人科医院,370-0044,高崎市岩押町31-10,027-327-0462,-,有,"月-土:9:00-12:30,14:00-18:00",有
医療法人矢崎会矢崎医院,370-0883,高崎市剣崎町1049-2,027-344-3511,-,有,月・火・水・金・土:9:00-17:30,有
産科婦人科舘出張佐藤病院,370-0836,高崎市若松町96,027-322-2243,https://www.sato-hospital.gr.jp/,有,月・火・木・金・土:8:00-17:00、水:8:00-12:00,有
海老原医院,370-0068,高崎市昭和町102,027-322-4721,-,有,月・火・水・金:9:00-18:00、土:9:00-13:00,有
豊泉クリニック,370-0851,高崎市上中居町416,027-326-2933,-,有,"月・火・水・金:9:00-12:00,15:00-17:30、木・土:9:00-12:00",有
医療法人翠松会松原医院,370-0018,高崎市新保町1585-1,027-353-4103,https://www.matsubara-ladies-clinic.com/,有,"月・火・水・金:9:00-12:00,15:00-18:00、木・土:9:00-12:00",有
いしもとレディースクリニック,370-3524,高崎市中泉町608-2,027-372-4188,https://www.ishimoto.or.jp/,有,"月・火・木・金:9:00-12:30,15:00-18:00、水・土:9:00-12:30",有
セントラルレディースクリニック,370-0045,高崎市東町80-7,027-326-7711,https://www.clc.or.jp/,有,"月・火・水・土:9:00-12:00,14:00-18:00、木:9:00-12:00、金:9:00-12:00,16:00-18:00",有
田村産婦人科,370-0815,高崎市柳川町63,027-323-8496,https://tamura-sanfujinka.jp/,有,平日:8:30-18:00、土:8:30-12:30,有
永山医院,379-0116,安中市安中3-19-19,027-381-0314,-,有,"月・火・木・金:9:00-12:00,15:00-18:00、水・土:9:00-12:00",有
根岸産婦人科小児科医院,375-0015,藤岡市中栗須86,0274-24-1111,http://negishi-clinic.info/,有,"月・火・水・金:9:00-12:00,15:00-17:30、土:9:00-12:00",有
医療法人和光会光病院,375-0023,藤岡市本郷1045,0274-24-1234,http://www.flash.or.jp/flash/index.html,有,月-土:9:00-18:00,無(院外処方)
医療法人 田村医院,370-2343,富岡市七日市1662-2,0274-64-2065,-,有,月・火・水・金:9:00-18:00、土:9:00-12:30,有
こすげレディスクリニック,370-2316,富岡市富岡1494-1,0274-62-0275,https://itp.ne.jp/info/100705116141031440/,有,"月・火・木・金・土:9:00-12:30,15:00-19:00",有
小泉医院,370-2316,富岡市富岡891,0274-62-0039,https://koizumi.or.jp/,有,"月・火・木・金:8:30-12:30,16:00-19:00、水:8:30-12:30、土:8:30-12:30,14:00-17:00",有
けんもち医院,377-0423,吾妻郡中之条町伊勢町837,0279-75-5155,-,有,月・火・水・金・土:8:30-16:30、木:8:30-11:30,有
西吾妻福祉病院,377-1308,吾妻郡長野原町大津746-4,0279-83-7111,https://www.nawh.jp/,有,木・金:8:30-16:30(産婦人科外来)、月・火・水:8:30-11:30(総合外来),有
沼田クリニック,378-0014,沼田市栄町61番地3,0278-22-1188,https://kijokai.or.jp/numata-clinic/,有,月・金:9:00-16:30,無
久保産婦人科医院,378-0056,沼田市高橋場町2031-4,0278-23-1360,https://www5.kannet.ne.jp/~kubo-cli/index.html,有,"月・火・水・金:9:00-11:30,14:00-17:30、土:9:00-11:30,13:00-15:30",有
塩崎医院,378-0016,沼田市清水町4211,0278-22-2451,http://www.shiozaki-iin.com/,有,"月・火・木・金:9:00-12:00,13:30-17:00、水・土:9:00-12:00",有
桐生厚生総合病院,376-0024,桐生市織姫町6-3,0277-44-7171,https://www.kosei-hospital.kiryu.gunma.jp/,有,24時間対応,有
たかのす診療所,376-0041,桐生市川内町2-289-1,0277-65-9229,http://www.sanikukai.com/takanosu/,有,"月・火・木・金:9:00-12:00,16:30-18:00、水・土:9:00-12:00",有
島村京子クリニック,376-0011,桐生市相生町一丁目141-1,0277-55-6611,http://shimamurakyoko-clinic.jp/,有,"月・火・木・金:9:00-12:00,14:00-17:30、水・土:9:00-12:00",有
医療法人重寿会くりはら医院,376-0035,桐生市仲町1-8-6,0277-44-3395,http://www.sunfield.ne.jp/~jyuujyu/,有,"月・火・水・木・土:9:00-13:00,15:00-18:00、金:9:00-13:00",有
岩宿クリニック,379-2311,みどり市笠懸町阿左美1506-3,0277-46-7200,https://iwajuku-cl.jp/,有,"月・火・水・金:9:00-12:00,15:00-18:00、木・土:9:00-12:00、※最終受付は終了時間30分前まで",有
ときざわレディスクリニック,373-0818,太田市小舞木町256,0276-60-2580,http://tokizawa.jp/,有,"月・水・金:9:00-12:30,16:00-18:30、火・木・土:9:00-12:30",有
医療法人社団岩崎会岩崎医院,373-0852,太田市新井町206,0276-45-5818,http://iwasaki-kai.byoinnavi.jp/pc/,有,"月・火・木・金・土:9:00-12:00,14:00-18:00、水:9:00-12:00",有
イムス太田中央総合病院,373-8513,太田市東今泉875ー1,0276-37-2378,http://www.ims.gr.jp/ohta/,有,"月・火・木・金:9:00-11:30,14:30-15:30、土:9:00-11:30",無(院外処方)
松本医院,373-0812,太田市東長岡町76,0276-46-8707,http://ota-med.jp/publics/index/311/,有,"月・火・水・金:9:00-12:30,14:00-18:00、土:9:00-12:30",有
たから女性クリニック,373-0036,太田市由良町2340-1,0276-32-2159,http://takara4lc.g1.xrea.com/,有,"平日:9:00-12:00,15:00-18:00、土:9:00-12:00",有
公立館林厚生病院,374-8533,館林市成島町262-1,0276-72-3140,http://www.tatebayashikoseibyoin.jp/,有,"平日:9:00-11:00,13:30-15:00",無(院外処方)
土井レディスクリニック,374-0043,館林市苗木町2599-128,0276-72-8841,http://www.doi-ladies.com/,有,"月・水・木・金:9:00-12:00,15:00-17:30、火・土:9:00-12:00",有
医療法人社団真中医院,374-0024,館林市本町3-4-5,0276-72-1630,http://www.med-manaka.org/,有,"月・火・水・金・土:9:00-12:30,14:30-17:30、木:9:00-12:00",有
Loading

0 comments on commit f58b245

Please sign in to comment.