
import csv
from create_dictionary import CreateDictionary
from column_combination import ColumnCombination
from transformation import Transformation
from rank import Rank
import time

input_data = {"meta":[{"name":"시도","type":"cat"},{"name":"시군구","type":"cat"},{"name":"사고유형대분류","type":"cat"},
                      {"name":"사고유형","type":"num"},{"name":"발생건수","type":"num"},{"name":"사망자수","type":"num"},{"name":"부상자수","type":"num"},
                      {"name":"중상","type":"num"},{"name":"경상","type":"num"},{"name":"부상신고","type":"num"}],
              "data":[["강원","홍천군","차대사람","길가장자리구역통행중",6.0,0.0,7.0,6.0,1.0,0.0],["강원","홍천군","차대사람","기타",6.0,0.0,6.0,4.0,2.0,0.0],
                      ["강원","홍천군","차대차","정면충돌",49.0,3.0,86.0,28.0,57.0,1.0],["강원","홍천군","차대차","측면충돌",120.0,2.0,185.0,33.0,150.0,2.0],
                      ["강원","홍천군","차대차","추돌",59.0,0.0,115.0,27.0,87.0,1.0],["강원","홍천군","차대차","기타",39.0,0.0,62.0,16.0,46.0,0.0],
                      ["강원","홍천군","차량단독","전도전복",24.0,2.0,34.0,14.0,19.0,1.0],["강원","홍천군","차량단독","공작물충돌",4.0,2.0,4.0,2.0,2.0,0.0],
                      ["강원","홍천군","차량단독","기타",2.0,0.0,2.0,1.0,1.0,0.0],["강원","횡성군","차대사람","횡단중",16.0,2.0,14.0,6.0,7.0,1.0],
                      ["강원","횡성군","차대사람","차도통행중",3.0,0.0,3.0,3.0,0.0,0.0],["강원","횡성군","차대사람","길가장자리구역통행중",3.0,0.0,3.0,2.0,1.0,0.0],
                      ["강원","횡성군","차대사람","기타",13.0,1.0,12.0,6.0,4.0,2.0],["강원","횡성군","차대차","정면충돌",42.0,2.0,90.0,33.0,54.0,3.0],
                      ["강원","횡성군","차대차","측면충돌",85.0,1.0,153.0,45.0,101.0,7.0],["강원","횡성군","차대차","추돌",53.0,1.0,186.0,30.0,153.0,3.0],
                      ["강원","횡성군","차대차","기타",21.0,1.0,38.0,16.0,19.0,3.0],["강원","횡성군","차량단독","전도전복",15.0,2.0,19.0,13.0,5.0,1.0],
                      ["강원","횡성군","차량단독","공작물충돌",1.0,0.0,3.0,2.0,1.0,0.0],["강원","횡성군","차량단독","기타",5.0,2.0,3.0,1.0,1.0,1.0],
                      ["강원","영월군","차대사람","횡단중",17.0,2.0,15.0,10.0,2.0,3.0],["강원","영월군","차대사람","차도통행중",2.0,0.0,2.0,2.0,0.0,0.0]]
              }

data_table = []
data_type = []
data_name = []

for i in range(len(input_data['meta'])):
    data_name.append(input_data['meta'][i]['name'])
    data_type.append(input_data['meta'][i]['type'])
data_table.append(data_name)
for i in range(len(input_data['data'])):
    data_table.append(input_data['data'][i])

print (input_data["meta"])