Skip to content

How to contribute samples and guide chapters

Atma Mani edited this page Sep 16, 2019 · 10 revisions

First off, thank you for writing for the ArcGIS API for Python. Below are some guidelines to follow when writing your notebooks. These will help maintain the quality of content and help our CICD system integrate your articles and publish them on the https://developers.arcgis.com/python website in a semi-automated process.

Coding standards for your notebooks

Checkout this article https://www.esri.com/about/newsroom/wp-content/uploads/2018/11/coding-standards-jupyter-ntbk.pdf for some guidelines on how to structure your notebooks and make them more reader friendly

Creating GIS connection

To promote secure practices, create GIS connections using profiles. We use the following reserved profile names

  • your_online_profile for arcgis_python account on ArcGIS Geosaurus Org
  • your_online_admin_profile for notebooks that require administrative creds to run against AGO (very few notebooks fall under this category)
  • your_enterprise_profile for arcgis_python account on PythonAPI Playground Enterprise
  • your_ent_admin_profile for administrator account on PythonAPI Playground Enterprise

On your machines, you need to create these profiles. We are in the process of making these profiles available on notebooks.esri.com site, so yours can run these notebooks readily. The overall idea is, our users will create corresponding profiles and run these against their own deployments.

Accessing the GIS data

The Python API team maintains an ArcGIS Enterprise running at https://pythonapi.playground.esri.com/portal/home/. You can access this Enterprise GIS from your notebooks using the credentials username: arcgis_python and password: amazing_arcgis_123. Any outputs, maps, layers etc. created by this account would be periodically erased.

To publish the layers required for your notebooks, use a different account: username: api_data_owner, password: email the maintainers of this repo. Once you publish the layers, delete protect it and share it for all in the organization. Share the original data (for features, zip up the shape file or file geodatabase, for rasters, zip up the geoTIFF or imagery files) and upload it as an item inside the original_data folder.

Thus the data usage pattern is to first publish your content using api_data_owner manually and then access it in the notebooks using the account arcgis_python. Esri holds ownership of the data you publish.

Embedding maps in your notebook

See How to embed map images in your notebook wiki for details. Submit your PRs with the maps embedded

Using images in your notebook

Place all image files you want to reference in a notebook in this location: arcgis-python-api/static/img/. Then, in a notebook, reference the image relatively like ../../static/img/foo.png

Alternatively, base-64 encode your images and reference them like <img src="base64strhere">

Using links in your notebook

If you want to reference another guide page from an existing guide page, use the full https://developers.arcgis.com/python/foo/bar/ path in a notebook

Submission checklist

  • Ensure your notebook file name is clear, descriptive, in lower cases and without spaces. You are allowed to use underscore or hyphen (dash).
  • Ensure your notebook has a title, introduction, and a conclusion
  • Ensure you are using profiles to connect to GIS
  • The order of preference when choosing a GIS is, (1) PythonAPI playground portal (2) Geosaurus AGO Org. Ensure you are not hitting any other Orgs or using any accounts other than the standard ones described above.
  • Ensure your notebook file name has all lower characters, spaces replaced with dashes, no apostrophe or special characters
  • Spell check your notebook
  • Follow the coding guidelines article to structure your content
  • Embed your map images
  • Ensure your notebook runs in a reliable fashion
Clone this wiki locally