CSVからKMZファイルを作成

import pandas as pd
import simplekml

# スプレッドシートのURL
url = "https://docs.google.com/spreadsheets/d/e/2PACX-1vRDgDbpuBUvGcK7TJKiwMSIfs5yi95qmERjZ_iXHMWSRDlarjwUoDVdvpXOB8a2zpnwpq4Vj9VBHJcf/pub?gid=592572816&single=true&output=csv"

df = pd.read_csv(url, index_col=0).fillna("")

df

kml = simplekml.Kml(name="Ehime")

# アイコン画像追加
path = kml.addfile("rakuten.png")

# スタイル
style = simplekml.Style()
style.labelstyle.color = simplekml.Color.red
style.labelstyle.scale = 2
style.iconstyle.icon.href = path

for _, r in df.iterrows():

    pnt = kml.newpoint(name=r["場所"])
    pnt.coords = [(r["経度"], r["緯度"])]
    pnt.style = style

    ex_data = simplekml.ExtendedData()

    for n, v in r.items():

        ex_data.newdata(name=str(n), value=str(v))

    pnt.extendeddata = ex_data

kml.savekmz("rakuten.kmz")