ArcGIS Blog

Announcements

ArcGIS API for Python

What's New in ArcGIS API for Python 2.4.1 (April 2025)

By Nicholas Giner and Halle Martinucci

The ArcGIS API for Python (e.g. “the Python API”) released version 2.4.1 on April 7, 2025.  A main focus of this release was to build upon the Jupyter Notebook 7 and JupyterLab 4 architecture changes implemented at 2.4.0, however there are several other important updates highlighted below.  You can also read the full release notes here, which includes a detailed list of bug fixes and deprecation notices.

Item dependency graphs

GIS administrators and other users who manage content within the organization often want to know all the item dependencies for any item type.  For example, I may want to know about the:

  • Layers in my web maps (e.g. Feature Layer -> Web Map)
  • Source files for published layers (e.g. File Geodatabase -> Feature Layer)
  • Visual components in a web app (e.g. Web Map in a StoryMap)
  • Attachments to other items (e.g. Microsoft Word Template in a Survey123 app)

The new itemgraph submodule in the apps module provides classes and functions for building a dependency graph of organizational Item content.  A dependency graph allows you to examine how items relate to each other in ArcGIS Online or Enterprise organizations—for example, which items are required for other items to exist.

That’s sounds great, but how can this functionality be used to solve a real-world problem?

Let’s say that you are a GIS administrator who has been tasked with migrating your organization’s items to a different portal.  Perhaps it is from ArcGIS Enterprise to Online, or maybe from a development environment to a production environment.  Before migrating, you want to ensure that all of your items (including your complex apps) are rendering correctly and not missing any data sources, but you don’t want to manually click through to check each one.  How can you more efficiently find out what’s missing?

Here are the high-level steps:

  • Create a dependency graph.
  • Identify the item ID’s that don’t correspond to existing or accessible items. Perhaps they no longer exist, are broken, or are not accessible to your organization.
  • Optionally visualize the dependency graph.
  • Replace the problematic item ID’s with the correct ID’s. This can be achieved using the remap_data method that was released in v2.4.0 of the Python API.
Example code for creating the dependency graph of a StoryMap.
Example visualization of the StoryMap’s dependency graph.

Offline cloning / Creating backups

After you have used the item dependency graph and remapping method to prepare your content for migration, you may want to create backups of the content.  You can use the new OfflineContentManager class to create a saved state of your items and their dependencies, which can then be restored in the event that something changes or is broken.  This class has methods to list items, export items, and import items.  This new class and its methods provide a great way to proactively prevent your content from breaking post-migration.

GDAL support for the Spatially Enabled DataFrame (SeDF)

The Spatially Enabled DataFrame (SeDF) allows you to easily convert your ArcGIS data (e.g. feature layers, file geodatabase feature classes, shapefiles, GeoJSON, etc.) back and forth between Pandas DataFrames, which makes it a powerful bridge between ArcGIS and the Python data science ecosystem.

Behind the scenes, the SeDF uses the concept of a “geometry engine” to work with and understand the geometry of geospatial data when converting it between different formats.  By default, the SeDF uses ArcPy as the geometry engine when it is available (e.g. when you have a license for it).  The biggest advantage of using ArcPy as the geometry engine is the ability to write to file geodatabases, however it does also have numerous other benefits such as full compatibility with the ArcGIS ecosystem and use of the geoprocessing framework.

The pain point here is that if you use the ArcGIS API for Python on Mac or Linux (or otherwise don’t have access to ArcPy), it was not possible to read/write file geodatabases.

With the release of v2.4.1, we’ve incorporated GDAL into the reading/writing functions of the SeDF.  GDAL stands for Geospatial Data Abstraction Library, which is an open-source library that can read/write a wide variety of raster and vector geospatial data formats. It already comes in the standard environment for ArcGIS Pro on Windows and the ArcGIS Notebook Runtimes, and can also be installed via Python package managers Conda and Pip. This means that file geodatabases are now easily read into/written from the SeDF on Mac and Linux, and there is now a more consistent data I/O experience regardless of which OS you use the Python API with.

All you need to do is set the processing environment at the top of your script and point to your geometry engine of choice, then import arcgis and whatever other Python libraries you need to use!

Supported platforms

  • Python versions
    • 3.11, with secondary support for 3.10 and 3.12
  • Esri products and their versions
    • ArcGIS Pro 3.5 and later default and cloned environments
    • ArcGIS Online June 2025 release
    • ArcGIS Enterprise 11.4 and later
      • Included with Enterprise 11.5 Notebook runtime
    • Stand-alone conda and Python environments

Community and collaboration

We want to remind you that there are excellent resources available for getting help with the API and sharing your feedback.  You can use the ArcGIS API for Python Esri Community page to ask specific questions, suggest ideas for enhancements and improvements, connect with other users, and read recent blogs.  You can also use the ArcGIS API for Python public GitHub repo to submit bugs, enhancement requests, and other issues.  The team actively monitors these pages and greatly appreciates your feedback and suggestions, which guide our priorities for future API development. We encourage you to share your thoughts!

Share this article