Python is a highly efficient and intuitive language that is pervasive throughout the ArcGIS Platform, as well as the larger scientific community. I personally love writing Python code because you can build sophisticated scripts that accomplish a wide array of tasks with relatively little effort or lines of code. Many ArcGIS users have picked up the scripting language in recent years and have found it to be invaluable in maximizing their productivity. However, one thing that I think most Python coders would agree with me on is that it isn’t very easy to make great looking UIs with Python. There are options, such as TkInter, that allow you to build up UIs from Python, but I would argue that the power of Python is in scripting procedural workflows, not in building beautiful UIs. There are, however, other languages and frameworks for building great UIs that integrate well with Python, and one of those is Qt.
- Python programmers now have a simple and intuitive way to build great looking UIs to execute their Python scripts.
- Qt/ArcGIS Runtime programmers can now leverage the power of Python and its many different packages (ArcPy, NumPy, matplotlib, Pandas, etc) in their native apps.
- It allows Python and QML to do what each language is best at, and separates the UI from the business logic.
- This could be a great bridge to Python developers wanting to learn ArcGIS Runtime technology, but not wanting to totally abandon their Python skills.
Building off of these different use cases, I put together a GitHub repo that shows some samples of how to integrate QML, Python, and ArcGIS through PyOtherSide. The examples include:
- A simple hello world sample that shows how to call a Python function
- An ArcPy integration sample, where a map is displayed with ArcGIS Runtime. On a mouse click, the latitude and longitude from the click event is passed into a Python function that uses ArcPy’s geometry operations.
- An elevation profile sample, where the z values of a polyline in ArcGIS Runtime are plotted through Python’s matplotlib.
- An Excel conversion sample, where an Excel spreadsheet is converted to CSV in Python, and is then published as a Feature Service in ArcGIS Online through the ArcGIS Runtime QML API.
These samples only scratch the surface of possible applications for this technology. However, I think they serve as a good starting point to understand how QML works (if you don’t already know) and how to call Python functions from QML. Whether you are a Python dev looking to build UIs or an ArcGIS Runtime dev looking to utilize your Python skills in your native apps, PyOtherSide is a powerful and intuitive plugin that opens the doors for many ArcGIS users. Please note that specific issues relating to integrating ArcGIS and PyOtherSide is not supported by Esri technical support (but don’t let that stop you from seeing what you can create!).