import io
from datetime import datetime, timedelta
from zipfile import ZipFile

from rosreestrXml.ui.tools.kptTools.kpt_10 import parse

path_zip=r"E:\Download\RossRestr\63_21_Клявлинский 2020.zip"
#path_zip=r"E:\Download\RossRestr\47_17_0102002_2020-04-06_kpt10.xml.zip"
start=datetime.now()
list_info_files=None
with ZipFile(path_zip,"r") as myzip:
    #print(myzip.infolist())
    list_info_files=myzip.infolist()
end_time=datetime.now()
list_file_name=[]
for file_info in list_info_files:
    name_file=file_info.filename.encode('cp437').decode('cp866')
    list_file_name.append({'source':file_info.filename,'encode':name_file})
    print(name_file)
with ZipFile(path_zip,"r") as myzip:
    for fiel in list_file_name:
        data_zip=myzip.read(fiel['source'])
        data_zip_str=data_zip.decode('utf-8')
        file_byte=io.BytesIO(data_zip)

        #ObjKpt = parse(file_byte, True)
        jkl=0
print(end_time-start)

