Using ArcPy to check which ArcGIS Pro Extensions are available for use

Table of Contents

Introduction

As of writing this blog post there is not neat ArcPy function to list all the ArcGIS Pro extensions available for a user, if I have completely missed it please point me in the right direction as I have put it up as an idea on the Esri Community forum.

Import the ArcPy module

ArcPy is a Python site package that enables automation, analysis, and management of geographic data within the ArcGIS software environment.

				
					import arcpy

				
			

Build the extensions code dictionary

The CheckExtensions() ArcPy function documentation contains a list of extensions available. We use the information in the documentation to build a dictionary where the key is the extension code and the value is the extension name.

				
					extensions = {
    "3D" : "ArcGIS 3D Analyst extension",
    "Aeronautical" : "ArcGIS Aviation Charting",
    "Airports" : "ArcGIS Aviation Airports",
    "ArcScan" : "ArcScan",
    "Bathymetry" : "ArcGIS Bathymetry",
    "BusinessPrem" : "ArcGIS Business Analyst",
    "DataReviewer" : "ArcGIS Data Reviewer",
    "DataInteroperability" : "ArcGIS Data Interoperability extension for Desktop",
    "Defense" : "ArcGIS Defense Mapping",
    "Foundation" : "ArcGIS Production Mapping",
    "GeoStats" : "ArcGIS Geostatistical Analyst extension",
    "Indoors" : "ArcGIS Indoors",
    "ImageAnalyst" : "Image Analyst",
    "JTX" : "ArcGIS Workflow Manager (Classic) Desktop",
    "LocationReferencing" : "ArcGIS Pipeline Referencing or ArcGIS Roads and Highways",
    "LocateXT": "LocateXT",
    "Nautical" : "ArcGIS Maritime",
    "Network" : "ArcGIS Network Analyst extension",
    "Publisher" : "ArcGIS Publisher",
    "Schematics" : "ArcGIS Schematics extension",
    "SMPAsiaPacific" : "StreetMap Premium Asia Pacific",
    "SMPEurope" : "StreetMap Premium Europe",
    "SMPJapan" : "StreetMap Premium Japan",
    "SMPLatinAmerica" : "StreetMap Premium Latin America",
    "SMPMiddleEastAfrica" : "StreetMap Premium Middle East Africa",
    "SMPNorthAmerica" : "StreetMap Premium North America",
    "Spatial" : "ArcGIS Spatial Analyst extension",
    "Tracking" : "ArcGIS Tracking Analyst extension"
}

				
			

Use list comprehension and CheckExtension to see what is available

When we call the CheckExtension ArcPy function and supply the name of the extension, “Available” is returned if that extension is available for the user to use. We use list comprehension to iterate over the keys in our dictionary and supply each as the parameter to the CheckExtension function. The list comprehension returns only the names of the extensions that are “Available”.

				
					available = [extensions[ext] for ext in extensions.keys() if arcpy.CheckExtension(ext) == "Available"]

print(available)
				
			

Leverage ArcPy for geospatial data management workflows within ArcGIS Pro. Learn the fundamentals of utilising ArcGIS Pro geoprocessing tools with ArcPy for data management, conversions, and analysis. This course is packed with amazing content that will help you discover the power of automating tasks within the ArcGIS Pro environment. Take your ArcPy skills from beginner to snake charmer. A little code goes a long way, a little ArcPy provides you with an in-demand skill. Sign up now for our highly rated course.

Leave a Comment

Your email address will not be published. Required fields are marked *