I cant seem to find a way to create a shp file from a AGOL feature service without having to create a shp file first that gets created in AGOL (adding something I dont need) then I export that shp onto my laptop. Is there a better way of doing it? Im looking for best practice.
This is what I have
###Variables
AGOL_Login = GIS("url", "username", "password", verify_cert=False)
itemToDownload = AGOL_Login.content.get("b6451dd141bbbd89a0e0fc")
exportLoc = r"C:\Users\youknowit\Desktop\PROJECTS\Downloads"
itemExportName_SHP = "test"
itemToDownload.export(itemExportName_SHP, "Shapefile", None, True)
searchForExportedItem = AGOL_Login.content.search(itemExportName_SHP)
exportedItemID = searchForExportedItem[0].id
getTheExportedItems = AGOL_Login.content.get(exportedItemID)
getTheExportedItems.download(exportLoc)