How can I update my layers in ArcGIS Online using Python?
From the platform I can upload one to one by overwrite tool. However, I'd like to know if there is some way by python to automate this task. At first, I've tried to update a shapefile in this way, but I want to update several shapefiles:
<SPAN class="" style="color: #101094; border: 0px; font-size: 13px;">from</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"> arcgis</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">.</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">gis </SPAN><SPAN class="" style="color: #101094; border: 0px; font-size: 13px;">import</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"> </SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">*</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">gis </SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">=</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"> GIS</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">(</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;">"url"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">,</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"> </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;">"username"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">,</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"> </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;">"password"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">)</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">data </SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">=</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"> </SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-size: 13px;">"C:\\xc\\Data\SDs\\states_21basic.zip"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">shpfile </SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">=</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"> gis</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">.</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">content</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">.</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">add</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">({},</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;"> data</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">)</SPAN>and then to publish it:
<SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">shpfile</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">.</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">publish</SPAN><SPAN class="" style="color: #303336; border: 0px; font-size: 13px;">()</SPAN>