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

Image Analyst

The Image Analyst module, arcpy.ia, is a Python module for managing and processing raster data with functionality provided by the ArcGIS Image Analystextension. It provides access to all the geoprocessing tools in the Image Analyst toolbox as well as functions and classes that allow you to automate your raster processing workflows.

Hinweis:

By default, not all Python libraries for deep learning raster analytics are installed in ArcGIS Notebook Server runtimes. You can extend a notebook runtime to include these libraries. See the Deep Learning Installation Guide for a manifest of the deep learning packages.

Learn more about the Image Analyst module

Mapping

Arcpy.mp ist ein Python-Submodul, das Bestandteil des ArcPy-Site-Pakets ist. Es wird mit ArcGIS Pro installiert und ist mit allen Lizenzen verfügbar. Es wurde in erster Linie konzipiert, um den Inhalt vorhandener Projekte (.aprx) und Layer-Dateien (.lyr oder .lyrx) zu bearbeiten. Außerdem enthält es Funktionen für das Automatisieren von Vorgängen zum Exportieren und Drucken. Arcpy.mp kann zur Automatisierung der Kartenherstellung verwendet werden und ist erforderlich, um umfassende Kartensammlungen zu erstellen, da es Funktionen zum Exportieren in PDF sowie zum Erstellen und Verwalten von PDF-Dokumenten enthält.

Learn more about the Mapping module

Hinweis:
The arcpy.mp module is used in ArcGIS Pro; the arcpy.mapping module is used in ArcMap.

Network Analyst

Das Network Analyst-Modul arcpy.nax ist ein modernes und benutzerfreundliches Python-Modul zum Arbeiten mit den Netzwerkanalysefunktionen, die mit der Erweiterung "ArcGIS Network Analyst" bereitgestellt werden. Es bietet Zugriff auf die folgenden Elemente:

  • Klassen zur Durchführung aller unterstützten Netzwerkanalysen
  • Klassen für das Arbeiten mit Informationen zur Konnektivität verschiedener Elemente, aus denen sich ein Netzwerk-Dataset zusammensetzt
  • Geoverarbeitungswerkzeuge zum Vorverarbeiten von Eingaben, Freigeben von Analyseergebnissen und Arbeiten mit Netzwerk-Datasets
  • Helper-Funktionen und -Klassen für das Arbeiten mit bestimmten Datentypen, die von den Klassen verwendet werden, mit denen Sie die Netzwerkanalyse durchführen können

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.

Mit dem Freigabemodul können Sie in einem ArcGIS Pro-Projekt einen Freigabeentwurf für eine Karte erstellen, der anschließend in ArcGIS Enterprise, ArcGIS Online oder ArcGIS Server freigegeben werden kann. Bei einem Freigabeentwurf handelt es sich um einen konfigurierbaren Satz von Eigenschaften für einen Web-Layer. Die Erstellung eines Freigabeentwurfs stellt den ersten Schritt dabei dar, die Freigabe von einzelnen Karten, Layern und Tabellen bzw. von Listen mit Layern und Tabellen als Web-Layer mithilfe von Python zu automatisieren. Der Freigabeentwurf kann im Anschluss als Service-Definitionsentwurfsdatei (.sddraft) gespeichert werden.

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

Hinweis:

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.