Working with Portal through Python
Since the ArcGIS APIs are RESTful, they can be programmatically accessed by any language that can make a web request. Python makes this very simple to do, and for that reason, virtually, all code samples that you will find from Esri are in Python, as are their wrapper libraries.
PortalPy
PortaPy is a Python 2.7 module written by Esri that installs with Portal into the Portal installation directory on your Portal server but is also available on Esri's GitHub account (https://github.com/Esri/portalpy). PortalPy can run from any machine with Python 2.7 installed, meaning you can configure this on your local PC that more than likely has ArcGIS Desktop installed, which comes with Python 2.7.x.
Installation and configuration
To work with PortalPy
from your local PC, you'll have to install the module. To do so, complete the following steps:
- On your PC, create a directory called
portalpy
(mine isC:\Projects\portalpy
). - Go to the
Esri GitHub portalpy
repository and download...