Hello,
My ultimate goal is pretty simple: I need to create a Story Map, add a web map to it, then save and publish it all from a python notebook. The documentation is unclear to me about how to accomplish this. Here "m" is my webmap object created in a prior process and "wmTitle" is stored in a variable. When I try to run this, it claims that object has no attribute "add." I've initiated the storymap library with
"from arcgis.apps.storymap import StoryMap"
Please help, I've tried going the cloning route and that's not working either. I've pored over the class arcgis.apps.storymap.story_content.Map() documentation and it doesn't tell me anything.
Thanks!
At a quick glance, storymap_item.save does not actually execute the save — it just references the method object.
In Python, methods need parentheses to run. So:
storymap_item.save → just points to the function in memory (no effect).
storymap_item.save() → calls the function, performs the save.
https://developers.arcgis.com/python-2-3/api-reference/arcgis.apps.storymap.html?
save(title=None, tags=None, access=None, publish=False)
This method will save your Story Map to your active GIS. The story will be saved with unpublished changes unless publish parameter is specified to True.
Same with publish:
storymap_item.publish # does nothing
storymap_item.publish() # actually publishes
https://developers.arcgis.com/python-2-3/api-reference/arcgis.gis.toc.html#arcgis.gis.Item.publish
publish(publish_parameters=None, address_fields=None, output_type=None, overwrite=False, file_type=None, build_initial_cache=False, item_id=None, geocode_service=None, future=False)