Analyze Tools For Pro (Data Management)

Summary

Analyzes Python scripts and custom geoprocessing tools and toolboxes for functionality that is not supported in ArcGIS Pro.

There are differences between ArcGIS Pro and ArcGIS 10.x that may mean changes to some custom tools and scripts are necessary so they run successfully in ArcGIS Pro. These changes include geoprocessing tools and environments that are not supported in ArcGIS Pro, the replacement of the arcpy.mapping module with the arcpy.mp module, unsupported data formats (such as a personal geodatabase), and the upgrade to Python 3 from Python 2.

Usage

  • Any issues identified will be included in the tool messages as warnings.

  • ArcGIS Pro uses Python 3. While many scripts may continue to work as they are, others will not.

    For information about updating Python scripts to work in ArcGIS Pro, see Python migration from 10.x to ArcGIS Pro.

  • For Python 2 to Python 3 upgrade issues, this tool uses the fissix module to review Python code. The fissix module is a modernized backport of the deprecated Python lib2to3 library.

Parameters

LabelExplanationData Type
Input

The input can be a geoprocessing toolbox or Python file.

Toolbox; String; File
Output File
(Optional)

An output text file that includes all issues.

File

arcpy.management.AnalyzeToolsForPro(input, {report})
NameExplanationData Type
input

The input can be a geoprocessing toolbox, Python file, or tool name.

Note:

If a tool name is provided, the tool must be loaded first using the arcpy.ImportToolbox function to be recognized. Include the toolbox alias with tool names.

Toolbox; String; File
report
(Optional)

An output text file that includes all issues.

File

Code sample

AnalyzeToolsForPro example 1

Analyze a Python script for ArcGIS Pro.

import arcpy
arcpy.management.AnalyzeToolsForPro('c:/tools/scripts/myutils.py', 'c:/temp/analyze_report.txt')

print(arcpy.GetMessages(1))
AnalyzeToolsForPro example 2

Analyze a geoprocessing toolbox for ArcGIS Pro.

import arcpy
arcpy.management.AnalyzeToolsForPro('c:/tools/scripts/mytools.tbx', 'c:/temp/analyze_report.txt')

print(arcpy.GetMessages(1))
AnalyzeToolsForPro example 3

Analyze a geoprocessing tool for ArcGIS Pro. To analyze a tool, first import the toolbox using ImportToolbox; then pass in the tool name with an alias to the AnalyzeToolsForPro function.

import arcpy

arcpy.ImportToolbox('c:/tools/scripts/mytools.tbx')
arcpy.management.AnalyzeToolsForPro('mytool_tools', 'c:/temp/analyze_report.txt')

print(arcpy.GetMessages(1))

Environments

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics