#Embedded Python

4 Followers · 292 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 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.

The result, by the way, can be se

0
0 344
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 1025
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 (https://geocoder.readthedoc









6
5 989
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:

1. Go to https://openexchange.intersyst

Request TTS input

2
2 502
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

Current Production (ac

3
4 1070
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.

USER>set st= ##class(User.PythonTest).t
9
2 948
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.

I believe that there’s a good chance you are d

simple test

0
0 2040
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 226
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:

  

As 2 jobs run in parallel the probability of just using sequential blocks is reduced.
During the development of this demo, I detected that the JOB command has problems
with ClassMethods in Embedded Py

1
0 268
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

I have a f

4
0 439
Article Evgeniy Potapov · Feb 27, 2022 2m read

We are happy to share interesting information with you, as well as tell you why Python is good, where it is used.

Among the most used libraries are NumPy and Pandas. NumPy (Numerical Python) is used to sort large datasets. It simplifies mathematical operations and their vectorization on arrays. Pandas offers two data structures: Series (a list of elements) and Data Frames (a table with multiple columns). This library converts data into a Data Frame, allowing you to remove and add new columns, as well as perform various operations.

Python offers countless tools for data analysis projects and




1
2 790
Article Muhammad Waseem · Feb 24, 2022 2m read

Hi, Community,

This post will demonstrate how to display data on the web by using Embedded Python , Python Flask Web Framework and Jquery datatable
image

We will display processes from %SYS.ProcessQuery table.

Step 1: Add table to HTML page and write below javascript code to display passed data from app.py :

HTML

  <table id="myTable" class="table table-bordered table-striped">                 
   </table>

Javascript

  <script>
    
$(document).ready(function() {
      // parse the data to local variable passed from app.py file
      let my_data = JSON.parse('{{ my_data | tojson }}');
0
0 2108
Article Muhammad Waseem · Feb 22, 2022 5m read

Hi Community,

This post is a introduction of my openexchange iris-python-apps application. Build by using Embedded Python and Python Flask Web Framework
Application also demonstrates some of the Python functionalities like Data Science, Data Plotting, Data Visualization and QR Code generation.

image

 

 Features

  •  Responsive bootstrap IRIS Dashboard

  •  View dashboard details along with interoperability events log and messages.

  •  Use of Python plotting from IRIS

  •  Use of Jupyter Notebook

  •  Introduction to Data Science, Data Plotting and Data Visualization.

  •  QR Code generator from python.

1
0 6735
Article Eduard Lebedyuk · Feb 17, 2022 2m read

If your embedded python code calls tkinter library (which is used by a lot of graphic producing libraries, including matplotlib), you might get this error:

<THROW> *%Exception.PythonException <CLASS DOES NOT EXIST> 230 ^^0^DO ##CLASS(User.Test).Test() 
<class '_tkinter.TclError'>: Can't find a usable init.tcl in the following directories:

c:/intersystems/irispy/lib/python/lib/tcl8.6
c:/intersystems/irispy/lib/tcl8.6
c:/intersystems/lib/tcl8.6
c:/intersystems/irispy/library
c:/intersystems/library
c:/intersystems/tcl8.6.9/library
c:/tcl8.6.9/library

This probably means that Tcl wa
0
1 3035
Article Robert Cemper · Feb 8, 2022 1m read

I have created a package to export a Global into JSON object file and to re-create it by reloading from this file   
embeddedPython refers to the new available technologies. It should be understood as a learning exercise of 
how to handle the language interfaces. Only Global nodes containing data are presented in the generated JSON file.
Differently from the previous example, this one is using embedded Python only, no ObjectScript. Therefore PURE

2
0 663
Announcement Anastasia Dyubaylo · Feb 1, 2022

Hi Community,

We are pleased to invite all the developers to the upcoming InterSystems Python Contest Kick-off Webinar! The topic of this webinar is dedicated to the Python contest.

In this webinar, we’ll present two templates to start working with Embedded Python :

  1. What is Embedded Python and Jupyter;
  2. Embedded Python with Interoperability (PEX hacked to use Embedded Python).

As always, our experts will answer the questions on how to develop, build, and deploy Python solutions using InterSystems IRIS.

Date & Time: Monday, February 7 – 12:00 PM EDT

Speakers:
🗣 @Guillaume Rongier, InterSystems Sales Engineer  
🗣 @Bob Kuszewski, InterSystems Product Manager
🗣 @Evgeny Shvarov, InterSystems Developer Ecosystem Manager

1
0 471
Announcement Evgeny Shvarov · Feb 7, 2022

Hi Developers!

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

  • Embedded Python - 4
  • Python Native API  - 3
  • Python Pex - 3
  • NoObjectScriptLine - 5
  • Questionnaire - 2
  • Docker container usage - 2 
  • ZPM Package deployment - 2
  • Online Demo - 2
  • First Article on Developer Community - 2
  • Second Article On DC - 1
  • Video on YouTube - 3

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

0
0 312
Announcement Derek Robinson · Feb 4, 2022

Hi all - we just released the first episode of Season 2 for our Data Points podcast by Learning Services. This episode features a conversation with @Bob Kuszewski about Embedded Python. If you're a Python developer, or if you're simply interested in the functionality, check it out! For more information, head over to https://datapoints.intersystems.com.

0
1 289