From the course: Python Scripting Using the ArcGIS API for Python
ArcGIS Python libraries: ArcPy and the ArcGIS API for Python
From the course: Python Scripting Using the ArcGIS API for Python
ArcGIS Python libraries: ArcPy and the ArcGIS API for Python
- [Instructor] When you're ready to start coding in ArcGIS, the place to start is to figure out which Python library you need. Esri has two Python libraries, ArcPy, and ArcGIS, and they serve complementary purposes. ARC PI is for working with ArcGIS Pro projects and file-based GIS data and local file systems. It's imported with import arcpy. ArcGIS, on the other hand, whose official name is the ArcGIS API for Python, is for working with online resources and managing your ArcGIS Online organizational account and your portals. It's imported with import arcgis. Let me explain the two in a bit more detail so you can decide on the appropriate library for the task. ArcPy is for accessing desktop resources, so for managing those projects and file and enterprise geodatabases and shape files. It's installed with ArcGIS Pro and it requires an ArcGIS Pro license. You can use it with any license level of ArcGIS Pro. ArcPy is also for running geoprocessing tools, like buffer and clip, as well as more complex tools for vector and raster analysis, like performing geospatial and statistical analysis using tools from Toolbox, and processing imagery with tools from Spatial Analyst, Geostatistical Analyst, and Image Analyst. So like, doing object detection and extraction. In fact, if I write a model in Model Builder like this one and I export it to a script, I'll just export it to the Python window here, you'll see that the tools used by Model Builder are called from the ArcPy library. You can see the import arcpy line right here. Okay, so ArcPy is useful for working with ArcGIS Pro projects and managing geospatial data and for analysis and geo processing. If you haven't used ArcPy before, you can learn about it in my course, Learning ArcGIS Python Scripting, that's right here on LinkedIn. Okay, but what about that other library? The ArcGIS API for Python. The ArcGIS API for Python, which you access by importing ArcGIS, is for accessing online resources. Its help is over here on the developer's page. By the way, there are a lot of ArcGIS libraries for many languages, not just Python. Check out this site to see more about other ways to programmatically interact with the ArcGIS platform. But if you're going to use ArcGIS Notebooks, which is the development environment built into Pro, Python is the only language that you can use here in Notebooks. The ArcGIS API for Python is for managing an organization's web GIS, either ArcGIS Online or Portal for ArcGIS. And it's before performing spatial analysis in the online environment. So the ArcGIS API lets you get access to the analysis tools, which we find in ArcGIS Online or in Portal for ArcGIS. Some of the things that can be done with the ArcGIS API for Python include managing online content, like uploading files and creating maps and publishing web services, managing ArcGIS Online and Portal users in groups, like creating and editing groups, managing a user's credit allocation, and setting permissions, and even reporting how much space is required for a user's content. It's also for working with online data, so feature services and feature layers and maps. I can change the base map of a bunch of my online maps all at once, for example, and for performing all sorts of analysis on data and maps, calculating statistics, doing overlay and proximity analysis, and for performing image analysis, including deep learning and object detection on imagery. So this is just a small sample of all the kinds of things you can do with the ArcGIS API for Python. So to recap, Esri provides two primary Python libraries for working with the ArcGIS platform, ArcPy if you're working in ArcGIS Pro and with desktop content, the ArcGIS API for Python if you're working with web resources. Whether you're automating desktop tasks or managing your web GIS, understanding these two Python libraries will help you work more efficiently.
Contents
-
-
-
ArcGIS Python libraries: ArcPy and the ArcGIS API for Python5m 9s
-
(Locked)
Accessing the ArcGIS API for Python4m 16s
-
(Locked)
ArcGIS notebooks: A development environment7m 36s
-
(Locked)
Creating a notebook and using Markdown cells7m 30s
-
(Locked)
The basics of ArcGIS Notebooks for writing code8m 13s
-
(Locked)
The GIS object and connecting to ArcGIS Online anonymously7m 41s
-
(Locked)
Connecting to your organization's ArcGIS Online account6m 37s
-
(Locked)
Understanding helper classes: Working with content and users5m 41s
-
-
-
-
-
-