#Python

0 Followers · 456 Posts

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

Official site.

InterSystems Python Binding Documentation.

Article Nikolay Solovyev · Jul 29 3m read

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.

Why Jinja2 for Emails

Jinja2 is a popular templating engine from the Python ecosystem that enables fully dynamic content generation. It supports:

0
0 0
Article Guillaume Rongier · Jul 28 3m read

This will be a short article about Python dunder methods, also known as magic methods.

What are Dunder 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:

0
0 0
Article Vachan C Rannore · Jul 24 1m read

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()

0
0 0
Article Guillaume Rongier · Jul 24 5m read

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.

What is a Module?

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?

0
0 0
Article Sylvain Guilbaud · Jul 18 8m read

🛠️ Managing InterSystems InterSystems API Manager (IAM = Kong Gateway) configurations in CI/CD

🔍 Context: InterSystems IAM configurations 

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.

0
0 0
Article Guillaume Rongier · Jul 17 5m read

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

How Python works

Interpreted Language

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:

0
0 0
Article Liam Evans · Jul 14 3m read

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:

0
0 0
Question Kunal Tiwari · Jul 10

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:

0
0 0
Article Henry Ames · Jun 18 2m read

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.

0
0 0
Question Scott Fadden · Nov 11, 2020
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?

4
0 333
Article Guillaume Rongier · Jul 8, 2024 6m read

Description

This is a template for a Flask application that can be deployed in IRIS as an native Web Application.

Installation

  1. Clone the repository
  2. Create a virtual environment
  3. Install the requirements
  4. Run the docker-compose file
git clone
cd iris-flask-template
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
docker-compose up

Usage

The base URL is http://localhost:53795/flask/.

Endpoints

0
0 0
Article Harry Tong · Jun 6 2m read

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:

0
0 0
Article Ashok Kumar T · Aug 30, 2024 3m read

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.

0
0 0
Article Heloisa Paiva · Mar 17, 2023 2m read

Why I've decided to write this

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.
 

Python object in IRIS

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:

0
2 527
Article Alex Alcivar · Jul 28, 2024 6m read

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

0
0 0
Article Henry Pereira · May 29 6m read

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.

🤖 Why We Built FHIRInsight

0
0 0
Question Touggourt · Apr 25

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?

 

0
0 0
Article Jim Liu · May 14 7m read

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".

 

  • Code Embedding model 

There are numerous embedding models designed for sentences and paragraphs, but they are not ideal for code specific embeddings.

0
0 0
Article Kunal Pandey · May 12 1m read

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

0
0 0
Article sween · Mar 4, 2024 8m read

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).

0
0 302