Useful tools for Esri Partners built with the ArcGIS API for Python
Partners working with Esri and ArcGIS implement many common workflows. The ArcGIS API for Python is an awesome automation library. This repo is meant to be a collection of POC scripts to automate some of these workflows.
While much of the code is in Jupyter Notebooks, it can easily be ported to pure python to run on the server or as headless apps. partnerutils/
can also be installed as a local package:
$ pip install -q -U git+https://github.com/mpayson/esri-partner-tools
- Install the ArcGIS API for Python (instructions)
- Access to Jupyter Notebooks
partnerutils/
- Functions that I've found helpfulcool_utils.py
- functions I want to remember and hopefully you will too!etl_utils.py
- assist with common ETL logicuser_utils.py
- assist with adding usersclone_utils.py
- assist with cloning groups & itemsfeature_utils.py
- assist with features and feature data types
common_workflows/
- Common workflows with the Python APIcsv_geocode.ipynb
- geocode rows incsvs
anddataframes
vector_data_products.ipynb
- end-to-end workflows for managing vector content and derivative information productsdistribute_items.ipynb
- common patterns for distributing items to another organizationstandard_geography.ipynb
- enrich standard geography ids, such ascensus blocks
, with geometries
feature_layers/
- Common operations with hosted feature layerscsv_upload.ipynb
- upload a folder ofcsvs
&dataframes
shapefile_upload.ipynb
- upload a folder ofShapefiles
geojson_upload.ipynb
- upload a geojson fileupdate_data.ipynb
- a couple different workflows for updating uploaded / hosted datacreate_views.ipynb
- create database views with separate permissions against one authoritative layermanage_fields.ipynb
- view and edit fieldsmanage_indexes.ipynb
- view, edit, and refresh indexesenable_time.ipynb
- add time metadata that will be reflected in ArcGIS app UIs
build_org/
- Automate new ArcGIS Online deploymentsclone_groups.ipynb
- clone groups and their itemsconfigure_org.ipynb
- customize org UI, create groups, & add userscreate_share_group.ipynb
- create a group and invite members to share content with your usersregister_application.ipynb
automatically create and register an app
Many samples use partnerutils
. To use this package, either copy & paste the functions as specified in each notebook OR:
$ pip install -q -U git+https://github.com/mpayson/esri-partner-tools
This will install the partnerutils
as a local package in your active environment. The utilities can then be used as follows
from arcgis.gis import GIS
from partnerutils.processing_utils import batch_geocode_memo
gis = GIS(username="username", password="password")
addresses = ['El Burrito Redlands CA', '380 New York St Redlands CA']
results = batch_geocode_memo(addresses)
print(results)
Shout out to Ryan @ SafeGraph for showing me this is a thing. Otherwise, the notebooks should give enough detail to get started. If not, holler!
I included some sample data for testing and trialing:
NYC_Restaurant_Inspections.csv
- a slice of DOHMH New York City Restaurant Inspection Results. Sourcesample_census_tract_geoid.csv
- a couple census tract geoids. Copied from here
Want to request a new sample? Have a question? Would love to hear from you.
And PRs always welcome!