storymap.save() python error - 'Item' object has no attribute 'save'

299
2
02-01-2024 01:35 AM
Labels (1)
JanDeBelder
New Contributor

Hi all,

I'm following API tutorials to manipulate storymaps with python but am facing an issue with saving of storymaps.

The pythoncode below is throwing following python error on the last line:

AttributeError: 'Item' object has no attribute 'save' 

Any ideas what i'm doing wrong ?

Code:

from arcgis.gis import GIS

# create arcgis online connection
gis=GIS("https://www.abc.com/arcgis","username","password")

# Retrieve a story by its ID
storymap_id = "xxxxxx"
storymap = gis.content.get(storymap_id)

print(storymap.title)

storymap.save()

 

0 Kudos
2 Replies
JohnEvans6
New Contributor III

I believe what you're looking for is update().

arcgis.gis module | ArcGIS API for Python

You can print dir(storymap) to get methods/attributes or help(storymap) to get the docs.

0 Kudos
JanDeBelder
New Contributor

Hi John, thanks.

Indeed, dir(storymap) does not include save(); although the api documentation does, here: https://developers.arcgis.com/python/api-reference/arcgis.apps.storymap.html#storymap )

the save statement is also part of some tutorials I found, including this one https://www.arcgis.com/home/item.html?id=f7e3bc074a3949c8b3c07512103e3917

Did 'save' get deprecated, maybe?

0 Kudos