#Embedded Python

0 Followers · 283 Posts

Embedded Python refers to the integration of the Python programming language into the InterSystems IRIS kernel, allowing developers to operate with data and develop business logic for server-side applications using Python.

Documentation.

Article José Pereira · Dec 27, 2021 12m read

In the previous articles, we learned the basics of using IMAP protocol to handle messages from mailboxes in an e-mail server. That was cool and interesting, but you could take advantage of implementations created by other ones, available in libraries ready to use.

One of the improvements to the IRIS data platform is the ability to write Python code alongside ObjectScript in the same IRIS process. This new feature is called Embedded Python. Embedded Python lets us bring to our ObjectScript code the power of the huge Python ecosystem’s libraries.

1
1 650
Announcement Evgeny Shvarov · Aug 29, 2022

Hi Developers!

Here're the technology bonuses for the InterSystems "Sustainability" Interoperability Contest 2022 that will give you extra points in the voting:

  • Sustainability Topic
  • Sustainability Dataset
  • Business Process BPL or Business Rule DTL Usage
  • Custom Interoperability Adapter
  • Production EXtension(PEX) Python, Java, or .NET usage
  • Embedded Python usage
  • Docker container usage
  • ZPM Package Deployment
  • Online Demo
  • Code Quality pass
  • Article on Developer Community
  • The second article on Developer Community
  • Video on YouTube

See the details below.<--break-><--break->

1
0 296
Article Yuri Marx · Aug 8, 2022 24m read

In this article you will have access to the curated base of articles from the InterSystems Developer Community of the most relevant topics to learning InterSystems IRIS. Find top published articles ranked by Machine Learning, Embedded Python, JSON, API and REST Applications, Manage and Configure InterSystems Environments, Docker and Cloud, VSCode, SQL, Analytics/BI, Globals, Security, DevOps, Interoperability, Native API. Learn and Enjoy!

Machine Learning

6
7 1021
Discussion Dmitry Maslennikov · Aug 3, 2022

I am aware that we have 5 License Units on Community Edition. But I have issues figuring out how it's working.

I have Community Edition

USER>write $system.License.KeyCustomerName()
InterSystems IRIS Community

Freshly started system, only terminal session open, so, only one license units used, and 4 left. As expected

USER>write $system.License.LUConsumed()
1
USER>write $system.License.LUAvailable()
4

Quote from documentation - $SYSTEM.License.MaxConnections() returns the maximum number of connections a user can make while consuming one license unit. 

16
1 660
Article Dmitry Maslennikov · Jul 30, 2022 5m read

Continuing to  observe the possibilities of Django, and usage with IRIS. The first we have looked how to define models and connect to tables already existing in IRIS, than we extended embedded Django Administration portal, with an ability to see what data we have in that models, with filters, editing and even pagination.

Time to go to real action, now we a going to create some REST API, on Django, based on the same data, we used before from the package posts-and-tags.

To do so, we will use Django REST Framework

Django REST framework is a powerful and flexible toolkit for building Web APIs.

0
0 411
Article Lucas Enard · Jul 27, 2022 7m read

Following this GitHub we will see how the FIX protocol can be implemented easily using IRIS and Python.

If you don't have much time focus on the Send a Quote before the Order part near the end, as it will, in a matter of minute, tell you how to send a Quote Request followed by an Order Request and show you the result from the server, and that in no more than five clicks.

IRIS-fix-protocol

Implementation of the fix protocol using an IRIS python container for the initiator and a regular python container for the acceptor.

4
0 991
Article Oliver Wilms · Jul 25, 2022 3m read

Hello,

I became aware of Python in the early 2000s when I started automating tasks. Some of our processes utilized python scripts. I never figured it out very well, and we decided to do away with Python because nobody on our team was familiar with it.

Along the way, I heard a lot about Python. My interest was renewed when InterSystems offered bonus points for using Python in contests.

The things I like the most about Python so far is how easy it is to find the mean of the ages of all Titanic passengers. For my test-data app I wanted to find the largest value in the ‘Qty’ column in a CSV file.

0
0 252
Announcement Olga Zavrazhnova · Jul 11, 2022

Hi Community,

We are excited to announce that InterSystems Developers Meetups are finally back in person!

The first Python-related meetup will take place on July 21 at 6:00 at Democracy Brewing, Boston, MA. There will be 2-3 short presentations related to Python, Q&A, networking sessions as well as free beer with snacks and brewery tours.

AGENDA:

0
0 443
Announcement Dmitry Maslennikov · Jan 13, 2022

I think it's a known fact that Populate Utility has very limited functionality. It supports only one language and one country. The list of possible values does not have so many options. 

There is a kind of tool that now can help with it, named Faker. It has implementations in different languages, including Python. Since IRIS has now had the Embedded Python feature, Python faker can be implemented in IRIS.

3
0 309
Article Lucas Enard · May 3, 2022 44m read

This formation, accessible on my GitHub, will cover, in half a hour, how to read and write in csv and txt files, insert and get inside the IRIS database and a distant database using Postgres or how to use a FLASK API, all of that using the Interoperability framework using ONLY Python following the PEP8 convention.

This formation can mostly be done using copy paste and will guide you through everystep before challenging you with a global exercise.
We are available to answer any question or doubt in the comment of that post, on teams or even by mail at lucas.enard@intersystems.com .

1
1 752
Article José Pereira · Apr 5, 2022 4m read

Motivation

This project was thought of when I was thinking of how to let Python code deal naturally with the scalable storage and efficient retrieving mechanism given by IRIS globals, through Embedded Python.

My initial idea was to create a kind of Python dictionary implementation using globals, but soon I realized that I should deal with object abstraction first.

So, I started creating some Python classes that could wrap Python objects, storing and retrieving their data in globals, i.e., serializing and deserializing Python objects in IRIS globals.

How does it work?

1
1 2298
Article Evgeniy Potapov · Jun 3, 2022 3m read

It is very interesting to compare different BI technologies. It is curious to me what the differences are in functionality, development tools, speed and usability.

For this application, I chose a dataset with water conditions in various European countries. This is an open source dataset containing observational data from 1991 to 2017.

The team and I decided to make a model based on this BI dataset using IRIS BI, Tableau, PowerBI and InterSystems Reports (powered by Logi Reports).

For the frontend, we made a web interface in PythonFlask via Embedded Python.

0
0 282
Article Muhammad Waseem · May 30, 2022 3m read

Hi Community,

This post is a introduction of my open exchange iris-fhir-client application.

 iris-fhir-client can connect to any open FHIR Server by using embedded python with the help of fhirpy Library.
Get Resource information by terminal and by using CSP web application.

2
0 894
Article Yuri Marx · May 20, 2022 8m read

One of the crucial business dimensions is the dimension “Where”. It is necessary to know where a customer was born or where he lives. Where will the order be delivered? Where have there been more sales, and where can we sell more? Where are our stores located? From Where is the customer accessing our e-commerce? These and other principal questions use the “Where” dimension. Today the best service to provide geographic accuracy and quality for these data is Google Maps. Taking advantage of the Python support of the new IRIS (2021.2+), we can use the Geocoder library

6
5 917
Article Yuri Marx · Feb 21, 2022 6m read

Hi Community,

Imagine enabling your application to read text to your customer? This is now possible with the new IRIS feature, Embedded Python. With this new functionality IRIS can natively run any open source or commercial Python libraries natively. gTTS (https://pypi.org/project/gTTS/) is a free library that transforms text into audio using the Google Translate service.

How to

Just pass the text by parameter and gTTS returns an mp3 file with the text transformed into audio. That is, your application can play the audio of any text! See how to do it:

2
2 431
Article Nicholai Mitchko · Apr 12, 2022 7m read

Programmatic Production Access

To Programmatically Edit Productions (interfaces) you can use a combination of the interoperability apis and SQL queries.

Current Namespace

At a high level, it is important to know the namespace and production you are working in at the moment.

// Object script 
// The active namespace is stored in this variable
$$$NAMESPACE 
// Print namespace
Write $$$NAMESPACE
# Python
import iris
# The active namespace is returned from this method
iris.utils._OriginalNamespace()
# Print namespace
print(iris.utils._OriginalNamespace())
>>> DEMONSTRATION
3
1 936
Question Megumi Kakechi · Apr 18, 2022

How can I get the Python error object(exception return value) from the embedded python method?
I have an embedded Python method like as below;

ClassMethod test2() As XXX [ Language = python ]
{
   try:
    a=1/0
   
   except Exception as ex:
    print("Exception: %s" % str(ex))
    return ex
}

I'm not sure what kind of return type to set for this classmethod.   "As XXX" <--
I tried to set "ClassMethod test2() As %Exception.PythonException [ Language = python ]"
However, I got the following return value when I run the method in the IRIS terminal.

9
2 831
Article Henry Pereira · Apr 6, 2022 7m read

All of us know that money is important. We constantly need to monitor all expenses to avoid looking back to the bank statement and thinking: “So, where’s my money?”

To evade financial stress, we must keep an eye on the inflow and outflow of money into our accounts.It is also important to tack when and how we spend and earn. Manually recording all transactions in order to understand where our money goes requires an effort. It demands consistency, and it is boring. Today there is a bunch of mobile or SaaS options that help you manage your finances.

0
0 1784
Announcement Kristina Lauer · Mar 25, 2022

March 2022 Learning Newsletter: Read and Subscribe  

See what's new in InterSystems Learning Services! In the March 2022 newsletter, you will: 

  • Get an overview of the new documentation search features.
  • Find content to help you prepare for certification as an HL7 Interface Specialist.
  • Learn the latest on Embedded Python
  • See how to start performing analytics in InterSystems IRIS® data platform.
0
0 202
Article Robert Cemper · Mar 19, 2022 2m read

This example demonstrates the difference you may experience when you write to
Gllobals directly from Embedded Python compared to native ObjectScript.

To make this demo useful I start 2 background jobs that simply write sequentially
to a dedicated global. A common control method signals for a synchronous start.
Similar a common stop & view interrupts data feeding.

That's the principle process:

  

1
0 232
Question Robert Cemper · Mar 11, 2022

It sounds strange though it's embarrassing.

I have a class with ClassMethods written in ISOS and Embedded Python.

The ClassMethods written in ISOS start in the Background as usual. No problems

But my 

ClassMethod setPy() [ Language = python ]
{
import iris, datetime, time
- - -

Just fails the JOB command with (even 15 sec) timeout and $ZC=0
This is not funny
My actual workaround:
I created a ClassMethod in ISOS, that does an elegant JobStart
and this ClassMethod only runs the Embedded Python ClassMethod.
I'm not amused and hope there is just an undocumented/unknown param missing

4
0 374