well...
"""
Script: kmz_kml.py
Author:
Dan.Patterson@carleton.ca
References: many
Purpose: convert kmz to kml base script
"""
import zipfile
from xml.dom import minidom
def kmz_to_kml(fname):
"""save kmz to kml"""
zf = zipfile.ZipFile(fname,'r')
for fn in zf.namelist():
if fn.endswith('.kml'):
content = zf.read(fn)
xmldoc = minidom.parseString(content)
out_name = (fname.replace(".kmz",".kml")).replace("\\","/")
out = open(out_name,'w')
out.writelines(xmldoc.toxml())
out.close()
else:
print("no kml file")
if __name__ == "__main__":
fname = r"Your_folder_here\GIS_central.kmz"
kmz_to_kml(fname)
found it. which could obviously be cleverly modified for batch production