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

253
1
Jump to solution
10-10-2019 10:41 AM
by Anonymous User
Not applicable

Any have suggestions?

0 Kudos
1 Solution

Accepted Solutions
GeoJosh
Esri Regular 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 Regular 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