<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Needing to automate the task of uploading hunderds of KMZ files to my ArcGIS Online account. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393209#M31116</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the python code I ended up using to accomplish this. Thanks for the help!&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS

path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'PATH'&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# the folder where the .kml and .kmz files are stored&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# List all .kml and .kmz files in the folder&lt;/SPAN&gt;
KMLs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; root&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dirs&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; files &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;walk&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; file &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; files&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'.kml'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; file &lt;SPAN class="operator token"&gt;or&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'.kmz'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; file&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            KMLs&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;root&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; file&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;            

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; KML &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; KMLs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KML&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"https://arcgis.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"USERNAME"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PASSWORD"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; verify_cert&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 
&lt;SPAN class="comment token"&gt;# Add the .kml and .kmz files&lt;/SPAN&gt;
Items &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; KML &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; KMLs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    kml_properties &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="string token"&gt;'type'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'KML'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="string token"&gt;'typeKeywords'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KML&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

    data_file_location &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KML
    &lt;SPAN class="comment token"&gt;# Add item to portal&lt;/SPAN&gt;
    add_KML &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;add&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item_properties &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kml_properties&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; data_file_location&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# Share item to everyone&lt;/SPAN&gt;
    add_KML&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;share&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;everyone &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    Items&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;add_KML&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Items

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; item &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; Items&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;": "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://OrganizationName.maps.arcgis.com/home/item.html?id="&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:01:14 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-11T18:01:14Z</dc:date>
    <item>
      <title>Needing to automate the task of uploading hunderds of KMZ files to my ArcGIS Online account.</title>
      <link>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393206#M31113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I recently converted a bunch of registered tif images to kmz format and now need to push these to AGOL as seperate files. Any ideas on how to automate this process?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2020 16:27:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393206#M31113</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-08-27T16:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Needing to automate the task of uploading hunderds of KMZ files to my ArcGIS Online account.</title>
      <link>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393207#M31114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anthony, Data Interoperability extension has a transformer called &lt;A href="https://hub.safe.com/publishers/safe/packages/esri-agol"&gt;ArcGISOnlineConnector &lt;/A&gt;that would let you batch this upload.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2020 16:46:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393207#M31114</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2020-08-27T16:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Needing to automate the task of uploading hunderds of KMZ files to my ArcGIS Online account.</title>
      <link>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393208#M31115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anthony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're looking for something more on the Python side, then the easiest way I can think of would be to use the ArcGIS API for Python. We can iterate through all the KMZ files and add them as items to your ArcGIS Online content. The specific method would be the add operation in the arcgis.gis.ContentManager class&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?highlight=gis%20content%20add#arcgis.gis.ContentManager.add" title="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html?highlight=gis%20content%20add#arcgis.gis.ContentManager.add"&gt;arcgis.gis module — arcgis 1.8.2 documentation&lt;/A&gt;&amp;nbsp;. KMZ files are a supported file format for ArcGIS Online (a full list can be found &lt;A href="https://doc.arcgis.com/en/arcgis-online/reference/supported-items.htm"&gt;here&lt;/A&gt;), so you should be able to do this directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's a sample:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;import arcgis&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;from arcgis.gis import GIS&lt;BR /&gt;gis=GIS("https://arcgis.com", "username" , "password")&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;properties={'title':'myKMZ', 'type':'KMZ','description':'myDescription','tags':'myTags'}&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;item = gis.content.add(item_properties=properties, data=r"\path\to\myKMZ.kmz")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To iterate through a folder, there is a sample script that can provide a solid starting point:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/python/sample-notebooks/publishing-sd-shapefiles-and-csv/#Publish-all-the-service-definition-files-in-a-folder" title="https://developers.arcgis.com/python/sample-notebooks/publishing-sd-shapefiles-and-csv/#Publish-all-the-service-definition-files-in-a-folder"&gt;Publishing SDs, Shapefiles and CSVs | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can just substitute KMZ files wherever we see SD files in the above sample, and we should be good to go.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Calvin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2020 17:18:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393208#M31115</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-08-27T17:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Needing to automate the task of uploading hunderds of KMZ files to my ArcGIS Online account.</title>
      <link>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393209#M31116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the python code I ended up using to accomplish this. Thanks for the help!&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; os
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS

path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'PATH'&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# the folder where the .kml and .kmz files are stored&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# List all .kml and .kmz files in the folder&lt;/SPAN&gt;
KMLs &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; root&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dirs&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; files &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;walk&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; file &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; files&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'.kml'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; file &lt;SPAN class="operator token"&gt;or&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'.kmz'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; file&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
            KMLs&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;root&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; file&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;            

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; KML &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; KMLs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KML&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"https://arcgis.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"USERNAME"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PASSWORD"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; verify_cert&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 
&lt;SPAN class="comment token"&gt;# Add the .kml and .kmz files&lt;/SPAN&gt;
Items &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; KML &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; KMLs&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    kml_properties &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
        &lt;SPAN class="string token"&gt;'type'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'KML'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
        &lt;SPAN class="string token"&gt;'typeKeywords'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KML&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

    data_file_location &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KML
    &lt;SPAN class="comment token"&gt;# Add item to portal&lt;/SPAN&gt;
    add_KML &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;add&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item_properties &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kml_properties&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; data_file_location&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;# Share item to everyone&lt;/SPAN&gt;
    add_KML&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;share&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;everyone &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    Items&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;add_KML&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

Items

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; item &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; Items&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

    &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;": "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"https://OrganizationName.maps.arcgis.com/home/item.html?id="&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; item&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;id&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:01:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393209#M31116</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T18:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: Needing to automate the task of uploading hunderds of KMZ files to my ArcGIS Online account.</title>
      <link>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393210#M31117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed publishing KML files using the script I provided doesn't give a service URL. If I upload a kml manually through the add items tool in arcgis online then it does give it a service url. Any ideas?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2020 21:41:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393210#M31117</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-08-31T21:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Needing to automate the task of uploading hunderds of KMZ files to my ArcGIS Online account.</title>
      <link>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393211#M31118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/8586"&gt;Jake Skinner&lt;/A&gt;‌&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have any ideas on my issue above with service url's not being generated if I upload my kml files through python?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2020 21:45:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/needing-to-automate-the-task-of-uploading-hunderds/m-p/393211#M31118</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-08-31T21:45:50Z</dc:date>
    </item>
  </channel>
</rss>

