Is there a way to download one of my tables in AGOL as a .csv using arcpy?

110
1
Jump to solution
10-10-2019 10:41 AM
vonmoosa
MVP

Any have suggestions?

0 Kudos
1 Solution

Accepted Solutions
GeoJosh
Esri Contributor

Anthony,

You can use the ArcGIS API for Python to do this. For example:

from arcgis.gis import GIS

portal = "https://arcgis.com"
username = "XXXX"
password = "XXXX"
gis = GIS(portal, username, password)

item = gis.content.get('XXXX')

csv = item.export("TEST", "CSV")

csv.download(r"C:\temp", "TESTING.csv")

Hope this helps!

-Josh

View solution in original post

1 Reply
GeoJosh
Esri Contributor

Anthony,

You can use the ArcGIS API for Python to do this. For example:

from arcgis.gis import GIS

portal = "https://arcgis.com"
username = "XXXX"
password = "XXXX"
gis = GIS(portal, username, password)

item = gis.content.get('XXXX')

csv = item.export("TEST", "CSV")

csv.download(r"C:\temp", "TESTING.csv")

Hope this helps!

-Josh