Essential Python vocabulary
This document introduces some vocabulary that is essential to understanding geoprocessing with Python help.
Term |
Description |
---|---|
Python |
Python is an open-source programming language that was conceived in the late 1980s by Guido van Rossum and introduced in 1991. It was first incorporated with ArcGIS 9.0 and has since become the preferred choice for users creating geoprocessing workflows. Python is supported by a growing and varied user community and provides easy readability, clean syntax, dynamic typing, and an extensive collection of standard and third-party libraries. |
ArcPy |
ArcPy (often referred to as the ArcPy site package) provides Python access for all geoprocessing tools, including extensions, as well as a wide variety of useful functions and classes for working with and interrogating GIS data. Using Python and ArcPy, you can develop an infinite number of useful programs that operate on geographic data. |
ArcPy modules |
A module is a Python file that generally includes functions and classes. ArcPy is supported by a series of modules, including a data access module (arcpy.da), mapping module (arcpy.mapping), an ArcGIS Spatial Analyst extension module (arcpy.sa), and an ArcGIS Network Analyst extension module (arcpy.na). |
ArcPy classes |
A class is analogous to an architectural blueprint. The blueprint provides the framework for how to create something. Classes can be used to create objects, often referred to as an instance. ArcPy classes, such as the SpatialReference and Extent classes, are often used as shortcuts to complete geoprocessing tool parameters that would otherwise have a more complicated string equivalent. |
ArcPy functions |
A function is a defined bit of functionality that does a specific task and can be incorporated into a larger program. In ArcPy, all geoprocessing tools are provided as functions, but not all functions are geoprocessing tools. In addition to tools, ArcPy provides a number of functions to better support geoprocessing Python workflows. Functions (often referred to as methods) can be used to list certain datasets, retrieve a dataset's properties, validate a table name before adding it to a geodatabase, or perform many other useful scripting tasks. |
Stand-alone Python script |
A stand-alone Python script is a .py file that can be executed from the operating system prompt, a Python Integrated Development Environment (IDE), or by double-clicking the .py file in Windows Explorer. |
Python script tool |
A Python script tool is a Python script that has been added to a geoprocessing toolbox. Once added as a script tool, the script tool becomes like any other geoprocessing tool—it can be opened and executed from the tool dialog box, used in the Python window and ModelBuilder, and called from other scripts and script tools. |
Python window |
The Python window is a quick and convenient place to use Python from within ArcGIS to interactively run geoprocessing tools and functionality as well as take advantage of other Python modules and libraries. This window also provides a gateway for you to learn Python. The Python window can be used to execute a single line of Python code, with the resulting messages printed to the window. It is a useful place to experiment with syntax and work with short lengths of code and provides an opportunity to test your ideas outside a larger script. |
Python add-in | A Python add-in is a customization written in Python, such as a collection of tools on a toolbar, that plugs into an ArcGIS for Desktop application that provides supplemental functionality for accomplishing custom tasks. To clarify the development of Python add-ins, you must download and use the Python Add-In Wizard to declare the type of customization. The wizard will generate all the required files necessary for the add-in to work. Click here to download the Python Add-In Wizard from the Geoprocessing Resource Center. |
Python toolbox | Python toolboxes are geoprocessing toolboxes that are created entirely in Python. A Python toolbox and the tools contained within look, act, and work just like toolboxes and tools created in any other way. A Python toolbox (.pyt) is an ASCII-based file that defines a toolbox and one or more tools. |