Skip To Content

Use ArcPy in a notebook

Several ArcPy modules are available in ArcGIS Notebooks through the Advanced notebook runtime.

With the ArcPy site package, you can perform geographic data analysis, conversion, and management. ArcPy allows you to programmatically run all ArcGIS standard geoprocessing tools and provides helper functions and classes.

Learn more about ArcPy

To use ArcPy in your notebook, ArcGIS Notebook Server must be licensed with the Advanced license, and users must have the privilege to create and run ArcPy notebooks.

ArcPy modules

The modules described below are included with ArcPy in ArcGIS Notebook Server.

Data Access

The data access module, arcpy.da, is a Python module for working with data. It allows control of the edit session, edit operation, improved cursor support (including faster performance), functions for converting tables and feature classes to and from NumPy arrays, and support for versioning, replicas, domains, and subtypes workflows.

Learn more about the Data Access module

Geocoding

The Geocoding module, arcpy.geocoding, allows you to explore and set locator properties and automate geocoding workflows. Geocoding is the process of transforming a description of a location—such as a pair of coordinates, an address, or a name of a place—to a location on the earth's surface. A locator is the tool used to perform geocoding operations. With this module, you can view and modify properties on the locator to tune it to your specific geocoding needs by customizing it for performance or quality. You can also use this module to perform various geocoding operations, including finding the location of a place or address, finding the closest place or address to a given location, or generating a set of autocomplete suggestions for partial input.

Learn more about the Geocoding module

Image Analysis

The Image Analysis module, arcpy.ia, is a Python module for managing and processing imagery and raster data. The module also includes functionality provided by the ArcGIS Image Analyst extension, such as all of the geoprocessing functions, as well as advanced functions and classes that allow you to automate your raster processing workflows.

Learn more about the Image Analysis module

Mapping

Arcpy.mp è un sottomodulo Python che fa parte del pacchetto di siti di ArcPy. Viene installato con ArcGIS Pro ed è disponibile per tutte le licenze. È stato concepito innanzitutto per manipolare i contenuti dei progetti esistenti​ (.aprx) e dei file layer (.lyr o .lyrx). Fornisce anche funzioni per automatizzare l'esportazione e la stampa. Arcpy.mp può essere utilizzato per automatizzare la produzione di mappe ed è richiesto per creare libri di mappe completi perché include funzioni per la creazione e la gestione di documenti PDF, nonché per l'esportazione su tali documenti.

Learn more about the Mapping module

Nota:
The arcpy.mp module is used in ArcGIS Pro; the arcpy.mapping module is used in ArcGIS Desktop.

Metadata

The Metadata module, arcpy.metadata, is a Python module for accessing and managing an item's metadata. You can explore information describing your maps and data and automate your workflows, particularly for managing standards-compliant geospatial metadata.

Learn more about the Metadata module

Network Analyst

Il modulo Network Analyst, arcpy.nax, è un modulo Python moderno e dal facile utilizzo per lavorare con la funzionalità di analisi di rete fornita con l'ArcGIS Network Analyst Extension. Fornisce l'accesso ai seguenti elementi:

  • Classi che consentono di eseguire tutte le analisi di rete supportate
  • Classi che consentono di lavorare con informazioni correlate alla connettività di vari elementi che costituiscono un dataset di rete
  • Strumenti di geoprocessing che consentono di pre-elaborare input, condividere i risultati delle analisi o lavorare con i dataset di rete
  • Le funzioni guida e le classi utilizzabili per lavorare con certi tipi di dati usati dalle classi che consentono di eseguire l'analisi di rete

Learn more about the Network Analyst module

The legacy module arcpy.na is not included with ArcGIS Notebooks.

Sharing

The arcpy.sharing module shares web layers using Python.

Il modulo di condivisione consente di creare una bozza di condivisione da una mappa in un progetto ArcGIS Pro, che può poi essere condiviso su ArcGIS Enterprise, ArcGIS Online o ArcGIS Server. Una bozza di condivisione è una serie di proprietà configurabile per un layer Web. Creare una bozza di condivisione è il primo passaggio per l'automatizzazione della pubblicazione di una mappa, layer, tabella o elenco di layer e tabelle su un layer web utilizzando Python. La bozza di condivisione può quindi essere salvata come file bozza della definizione del servizio (.sddraft).

Learn more about the Sharing module

Spatial Analyst

The Spatial Analyst module is a Python module for analyzing raster data with the functionality provided by the ArcGIS Spatial Analyst extension. It provides access to all the geoprocessing tools available in the Spatial Analyst toolbox as well as other helper functions and classes that allow you to more easily automate your workflows using Python.

Learn more about the Spatial Analyst module

Nota:

The Workflow Manager (arcpy.wmx) module is not included with ArcGIS Notebook Server.

Get started with ArcPy in a notebook

To use ArcPy in a notebook, import its library by running a cell with the following lines:

import arcpy
arcpy.GetInstallInfo()['Version']

View the sample notebooks that are included with ArcGIS Notebook Server to learn how ArcPy can be used in your own notebooks.