This is the completed solution for the Import data ArcGIS DevLab. ArcGIS DevLabs are short introductory tutorials to guide you through the three phases of building geospatial apps: Data, Design, Develop
If you have not completed the Download data lab, the code in the The Download Data Lab cell immediately below must be run before the Import Data Lab cells will run. These cells contain the code in the ArcGIS API for Python Download data lab solution. The LA_Hub_Datasets.zip directory from which you import data is only available in a single notebooks.esri.com session.
If you have completed the Download data lab and are still in that notebook, skip to The Import Data Lab section of this lab.
import getpass
password = getpass.getpass("Enter password, please: ")
gis = GIS('https://arcgis.com', 'username', password)
Enter password, please: ········
parks_properties = {'title': 'Parks and Open Space',
'tags': 'parks, open data, devlabs',
'type': 'Shapefile'}
parks_shp = gis.content.add(parks_properties,
data='./LA_Hub_datasets/Parks_and_Open_Space.zip')
parks_shp
parks_feature_layer = parks_shp.publish()
parks_feature_layer.url
'https://services1.arcgis.com/uRIm5IkWjDXybgFb/arcgis/rest/services/Parks_and_Open_Space/FeatureServer'