I am writing this post primarily to gather an informal consensus on how developers are using Python in conjunction with IRIS, so please respond to the poll at the end of this article! In the body of the article, I'll give some background on each choice provided, as well as the advantages for each, but feel free to skim over it and just respond to the poll.
As most of you are probably aware, Python is currently the most popular programming language among developers around the world - and for good reason. Python is intuitive, easy to read, has an expanse of libraries and packages, and offers a number of resources for solving almost any problem. For these reasons and more, Python is a natural first choice for developers.
So, when a developer first starts working with InterSystems IRIS, a common question might come up: "Can I use Python while still getting the most out of IRIS?" The answer? "Yes!" This article will introduce a few of the most common ways Python can be used in conjunction with InterSystems IRIS.
Options for Using Python with IRIS:
1. Embedded Python:
Introduced in 2021, Embedded Python allows for writing and executing Python code directly within ObjectScript. This allows for side-by-side use of Python and ObjectScript, allowing developers to integrate Python and IRIS. This is a great choice for those who want to use Python while never leaving the IRIS environment.
2. ODBC Connectivity, via pyODBC:
You can also connect external Python apps to IRIS using ODBC, just like in a traditional client-server architectures. This is probably the most widely-used integration method, since it uses familiar SQL-based workflows for Python developers. The pyODBC package supports the DB API 2.0 specification, and lets you execute SQL queries on IRIS databases.
3.InterSYstems Native API and ELS:
These two options give you more flexible integration between Python and IRIS:
a. Native API for Python: this gives direct access to core IRIS features like persistent classes and global structures. It's best for when you want to work with IRIS-specific consturcts programmatically from Python.
b. External Language Server: This lets IRIS to call out to Python code running in a separate process, or even on a separate server. It's super useful when the Python code is resource-intensive (high CPU oor memory usage) or when you might want isolation from the IRIS kernel for stability/scalability.
In Summary:
Python and InterSystems IRIS complement each other well. Whether you're a developer with limited ObjectScript experience, someone who's looking to take advantage of Python's ecosystem, or simply prefer writing code in Python, there are several integration paths available to you. Each option has different benefits based on your architecture and use case.
Thank you for reading this brief overview of the ways you can use Python with InterSystems IRIS!