
In this section, we will explore how to use Python as the primary language in IRIS, allowing you to write your application logic in Python while still leveraging the power of IRIS.
Python is an interpreted high-level programming language for general-purpose programming. Created by Guido van Rossum and first released in 1991, Python has a design philosophy that emphasizes code readability, notably using significant whitespace

In this section, we will explore how to use Python as the primary language in IRIS, allowing you to write your application logic in Python while still leveraging the power of IRIS.

Now that we have a good understanding of Python and its features, let's explore how we can leverage Python within IRIS.
Sending emails is a common requirement in integration scenarios — whether for client reminders, automatic reports, or transaction confirmations. Static messages quickly become hard to maintain and personalize. This is where the templated_email module comes in, combining InterSystems IRIS Interoperability with the power of Jinja2 templates.
Jinja2 is a popular templating engine from the Python ecosystem that enables fully dynamic content generation. It supports:
This will be a short article about Python dunder methods, also known as magic methods.
Dunder methods are special methods in Python that start and end with double underscores (__). They allow you to define the behavior of your objects for built-in operations, such as addition, subtraction, string representation, and more.
Some common dunder methods include:
Are you curious about how to run Python scripts directly in your InterSystems IRIS or Caché terminal? 🤔 Good news it's easy! 😆 IRIS supports Embedded Python, allowing you to use Python interactively within its terminal environment.
How to access the Python Shell?
To launch the Python shell from the IRIS terminal, simply run the following command:
do##class(%SYS.Python).Shell()This opens an interactive Python shell inside the IRIS terminal. From here, you can write and run Python code just as you would in a normal Python environment.
Exiting the Shell:
>>> quit()
Modules what a topic! We don't have this notion in ObjectScript, but it's a fundamental concept in Python. Let's discover it together.
I see modules as an intermediate layer between classes and packages. Let see it by example.
A bad example :
# MyClass.py
class MyClass:
def my_method(self):
print("Hello from MyClass!")
When you try to use this class in another script, you would do:
# class_usage.py
from MyClass import MyClass # weird, right?
my_instance = MyClass()
my_instance.my_method()
Why this is a bad example?
This will be a short article about PEP 8, the Python style guide.
In a nutshell, PEP 8 provides guidelines and best practices on how to write Python code.
🛠️ Managing InterSystems InterSystems API Manager (IAM = Kong Gateway) configurations in CI/CD
As part of integrating InterSystems IRIS into a secure and controlled environment, InterSystems IAM relies on Kong Gateway to manage exposed APIs.
Kong acts as a modern API Gateway, capable of handling authentication, security, traffic management, plugins, and more.
This will be an introduction to Python programming in the context of IRIS.
Before anything I will cover an important topic: How python works, this will help you understand some issues and limitations you may encounter when working with Python in IRIS.
All the articles and examples can be found in this git repository: iris-python-article
Python is an interpreted language, which means that the code is executed line by line at runtime even when you import a script.
What does this mean ? Let's take a look at the following code:
Hey Community!
We're happy to share the next video in the "Code to Care" series on our InterSystems Developers YouTube:
⏯ Agentic AI in Action: Building a Decision-Making Loop with LLMs
For my intern project, I am building a Flask REST API backend. My goal is to host it on InterSystems IRIS using the WSGI interface. This is a relatively new approach and is currently only being used in a handful of projects such as AskMe. To help others get started, I decided to write this article to simplify the process.
Creating a Basic Flask App
First, let’s create a minimal Flask application. Here is the code:
Hello,
I'm trying to connect a Python backend application to an InterSystems IRIS Community Edition instance running in a Docker container on an AWS EC2 instance. I'm facing persistent connection issues and an SSL Error despite the Superserver apparently having SSL disabled. I'm hoping for some insight into what might be causing this contradictory behavior.
My Setup:
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.
I was wondering what best practice was for using macros in Embedded Python, i.e. iris.execute('$$$MACRO()') or something else. Does anyone have insight into this?
Learn how to design scalable, autonomous AI agents that combine reasoning, vector search, and tool integration using LangGraph.
Hey Community!
We're happy to share the next video in the "Code to Care" series on our InterSystems Developers YouTube:
I am trying to create a database using python. The example shows setting a Name string and a Properties object containing Directory=.
; Use class methods to create an instance
%SYS>s Name="ABC"
%SYS>s Properties("Directory")="c:\abc\"
%SYS>s Status=##Class(Config.Databases).Create(Name,.Properties)
%SYS>i '$$$ISOK(Status) w !,"Error="_$SYSTEM.Status.GetErrorText(Status)How do I update and pass the Directory property using Python?
This is a template for a Flask application that can be deployed in IRIS as an native Web Application.
git clone
cd iris-flask-template
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
docker-compose up
The base URL is http://localhost:53795/flask/.
If you're migrating from Oracle to InterSystems IRIS—like many of my customers—you may run into Oracle-specific SQL patterns that need translation.
Take this example:
SELECT (TO_DATE('2023-05-12','YYYY-MM-DD') - LEVEL + 1) AS gap_date
FROM dual
CONNECT BY LEVEL <= (TO_DATE('2023-05-12','YYYY-MM-DD') - TO_DATE('2023-05-02','YYYY-MM-DD') + 1);
In Oracle:
Hello Community
I have previously experimented with embedded Python in IRIS; however, I have not yet had the opportunity to implement IRIS using native Python. In this article, I aim to outline the steps I took to begin learning and implementing IRIS within the Python source. I would also like thank to @Guillaume Rongier and @Luis Angel Pérez Ramos for their help in resolving the issues I encountered during my recent PIP installation of IRIS in Python, which ultimately enabled it to function properly.
Let's begin to write IRIS in python.
In my last article I've talked about returning values with Python. But returning them is simple, what can make it harder is what I'm going to talk about today: where the value is treated.
Following the example of the last aricle, we have the method:
Class python.returnTest [ Abstract ]
{
ClassMethod returnSomething(pValue... As%String) As%Integer [ Language = python ]
{
return pValue
}
}
Then, we'll have as a return a Python object, that IRIS interprets as the class %SYS.Python. So if I call the method with two values, like this:
For a long time I have wanted to learn the Django framework, but another more pressing project has always taken priority. Like many developers, I use python when it comes to machine learning, but when I first learned web programming PHP was still enjoying primacy, and so when it was time for me to pick up a new complicated framework for creating web applications to publish my machine learning work, I still turned to PHP. For a while I have been using a framework called Laravel to build my websites, and this PHP framework introduced me to the modern Model-View-Controller pattern of web
You know that feeling when you get your blood test results and it all looks like Greek? That's the problem FHIRInsight is here to solve. It started with the idea that medical data shouldn't be scary or confusing – it should be something we can all use. Blood tests are incredibly common for checking our health, but let's be honest, understanding them is tough for most folks, and sometimes even for medical staff who don't specialize in lab work. FHIRInsight wants to make that whole process easier and the information more actionable.
Are you using Jupyter Notebooks with IRIS? Are you using the vscode-iris-jupyter-server VS Code extension for your notebooking? If so, please let me know either via direct message or with a comment on this post. I'd like to hear more about how our customers are working with tool specifically, and with data science more generally.
Thanks!
I'm trying to deploy a python/flask application to an Iris4Health container (2025.1) but running into some issues with packages and where they should be installed.
Hi Guys,
I'm a newbie running IRIS in a container (IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2024.3 (Build 217U) Thu Nov 14 2024 17:30:43 EST) and trying to setup Python so I can start working on ML & Autosklearn,my understanding is that IRIS already comes with embedded Python but unable to do something like "import pandas as pd" in VSCode which looks like I need install a more complete version of Python or packages, so what I'm missing?
This article presents a potential solution for semantic code search in TrakCare using IRIS Vector Search.
Here's a brief overview of results from the TrakCare Semantic code search for the query: "Validation before database object save".
There are numerous embedding models designed for sentences and paragraphs, but they are not ideal for code specific embeddings.
Introducing Smart Clinical Sidechick — the intelligent, no-drama partner your EHR wishes it could be. She reads FHIR data in real time, interprets lab results without ghosting, and explains clinical alerts like she actually cares. Built with GPT-4 brains and YAML sass, she’s not here to replace your main EHR—just to make it look bad. Tired of irrelevant alerts and cryptic warnings? Sidechick serves up real, explainable insights, not vague “elevated risk” vibes. And when your backend crashes, she doesn’t panic—she self-heals. Secure, responsive, and (unlike your last vendor) emotionally
If you are a customer of the new InterSystems IRIS® Cloud SQL and InterSystems IRIS® Cloud IntegratedML® cloud offerings and want access to the metrics of your deployments and send them to your own Observability platform, here is a quick and dirty way to get it done by sending the metrics to Google Cloud Platform Monitoring (formerly StackDriver).