#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 Yuri Marx · Jan 9, 2023 7m read

Applications that work with bill payments and receipts, as well as the delivery and inventory of items, generally require the use of barcodes or QR Codes. The latter is used in even broader scenarios since the QR Code can store more information than a simple bar code. Thus, it is important to have the ability to generate barcodes and QR Codes or read the data stored in them from an image or a PDF. This article will show you how to do this using Python and some of its free libraries.

Pyzbar library

1
2 1537
Article Rizmaan Marikar · Jul 27, 2022 6m read

What is Web Scraping:

In simple terms, Web scrapingweb harvesting, or web data extraction is an automated process of collecting large data(unstructured) from websites. The user can extract all the data on particular sites or the specific data as per the requirement. The data collected can be stored in a structured format for further analysis.

What is Web Scraping? — James Le
Steps involved in web scraping:

  1. Find the URL of the webpage that you want to scrape
  2. Select the particular elements by inspecting
  3. Write the code to get the content of the selected elements
  4. Store the data in the required format

It’s that simple !!

12
9 1659
Article Jean Millette · Oct 26, 2022 7m read

TL;DR: This article describes an introductory-level project that exercises some string-manipulation functions in both ObjectScript and Python…with specs from a song.

After you’ve written your first “Hello World!” program, are you ready for a new fun challenge?  An old, very popular (at the time) song may be just what you need.

3
0 335
Article José Pereira · May 2, 2022 16m read

Introduction

This article aims to give an introduction to what gRPC is and an example of how to play with the official Hello World using IRIS Embedded Python.

You can find all the code exposed here, in this project repo.

gRPC

The gRPC (gRPC remote procedure call) is an API architectural style based on the RPC protocol. The project was created by Google in 2015 and is licensed under Apache 2.0. Currently, the project is supported by the Cloud Native Computing Foundation (CNCF).

5
0 1956
Article Yaron Munz · Jul 12, 2022 5m read

Overview

We started to use Azure Service Bus (ASB) as an enterprise messaging solution 3 years ago. It is being used to publish and consume data between many applications in the organization. Since the data flow is complex, and one application’s data is usually needed in multi applications the “publisher” ---> ”multiple subscribers” model was a great fit. The ASB usage in the organization is dozens of millions of messages per day, while IRIS platform is having around 2-3 million messages/day.

The Problem with ASB

3
2 785
Question Evgeny Shvarov · Oct 21, 2022

Hi developers!

Those who code IRIS solutions in VSCode using Docker often use the convenient ObjectScript menu, which contains links to Management Portal, Class Reference, Unittest portal, Productions, etc.

While drilling down to a Dev Container to code Embedded Python there is no such option, at least within my settings:

So I don't know how to connect to it. 

Thoughts?

6
0 354
Article Evgeny Shvarov · Oct 24, 2022 4m read

Hi developers!

Let me share with you a minimal embedded python template, that I can recommend as a starting point for any general project with InterSystems IRIS that will use embedded python.

Features:

  • Embedded Python ready;
  • Examples of 3 ways of Embedded python development;
  • VSCode development ready;
  • Docker enabled;
  • Online demo enabled;
  • ZPM First development ready.

Let's discuss the features below!

0
0 1062
Question Evgeny Shvarov · Oct 20, 2022

Hi, devs!

What's the way to call the methods of %SYSTEM class from python?

I tried this way:

print(iris.cls('_SYSTEM.OBJ').Version())

and getting an error:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
RuntimeError: iris.class: error finding class

Here is how it works in ObjectScript:

USER>w##class(%SYSTEM.OBJ).Version()
InterSystems IRIS Version 2022.1.0.209
USER>

Thoughts?

4
0 328
Question Evgeny Shvarov · Oct 20, 2022

Hi folks!

I'm playing with Embedded python with IRIS trying to do some 'hello-world' exercises.

I'm running IRIS in container and have the following python code:

# Program to test coding with IRIS

print('Hello World')

# Run IRIS Class Method import iris
print(iris.cls('dc.sample.ObjectScript')).Test()

So, when I execute it, I get the following:

5
0 569
Article Lucas Enard · Aug 17, 2022 9m read

In this GitHub based on this InterSystems community rest api template Guillaume and I have created this example of all the import CRUD operations usable using ONLY Python on IRIS and using Flask.

Using the IRIS ORM or by simply doing SQL requests as both methods are seen in the GitHub.

1. intersystems-iris-docker-rest-template

This is a template of a REST API application built in python in InterSystems IRIS. It also has OPEN API spec, can be developed with Docker and VSCode.

13
0 822
Article Henry Pereira · Aug 2, 2021 8m read

Easy, easy, I'm not promoting a war against the machines in the best sci-fi way to avoid world domination of Ultron or Skynet. Not yet, not yet 🤔

I invite you to challenge the machines through the creation of a very simple game using ObjectScript with embedded Python.

I have to say that I got super excited with the feature of Embedded Python on InterSystems IRIS, it's incredible the bunch of possibilities that opens to create fantastic apps.

Let's build a tic tac toe, the rules are quite simple and I believe that everyone knows how to play.

8
5 1493
Question Evgeny Shvarov · Oct 8, 2022

Folks!

Could you please share any best practices on how to debug Embedded Python code?

Given I have the following class method:

ClassMethod HideShip() As %Status [ Language = python ]
{
    import iris
    shipsgl=iris.gref(iris.cls(__name__)._GetParameter("BoardStorage"))
    shipsgl.kill()
    from random import Random
    board=iris.cls(__name__)._GetParameter("BoardRange")
    x=random.randint(0,board+1)
    y=random.randint(0,board+1)
    shipsgl.set([x,y],1)
}

And when I run it shows the following error:

5
0 888
Question Evgeny Shvarov · Oct 6, 2022

Hi folks!

I'm working with a global via Embedded Python as a class method. I init the handler for a global via:

gl=iris.gref("^Global")

What is the way to check the value at index ^Global("x","y")? E.g.:

In ObjectScript I'd do the following:

set result=$data(^Global("x","y"))

How do I do the same in Embedded Python?

I checked the documentation, but haven't found an answer.

4
0 251
Announcement Olga Zavrazhnova · Oct 6, 2022

Hi Community, 

Join us for an InterSystems Developer Meetup during TechCrunch Disrupt 2022!

We’ll be meeting on Wednesday, October 19th at Bartlett Hall, located at 242 O’Farrell St. (just a few short blocks from the Moscone Center) starting at 6 pm through 8:30 pm PT, where speakers will discuss how developers can bring the code to the data, not data to the code with Embedded Python and Integrated ML on InterSystems IRIS.

Food and drinks will be served accompanied by discussions. 

Agenda:

0
0 328
Article Guillaume Rongier · Sep 30, 2022 8m read

grpc-iris-interop

The aim of this proof of concept is to show how the gRPC protocl can be implemented with the IRIS ineroperabilty module.

architecture

On this schema, we can see that the gRPC Service is hosted by IRIS.

This service must invoke the IRIS interoperability module. For that it transforms the protobuf messages to IRIS messages.

The gRPC client is host by a Flask server for demo purpose, the gRPC client can also be invoke by the python script.

definition of each file

users.proto

0
0 652
Article Jimmy Xu · Sep 26, 2022 3m read

Hi Developers,

Python has a large and powerful ecosystem that contains thousands of libraries and packages available, especially in data science.

Therefore, I wanted to have a first try in using a recent feature of IRIS called Embedded Python, to simply import a python library called datetime, generate data with a timestamp component and persist it in InterSystems IRIS for Health Data Platform. The same will work on IRIS Data Platform as well.

5
1 404
Question Guillaume Rongier · Sep 23, 2022

Hello,

I'm looking for a way to write a stored procedure or something to return a ResultSet with Embedded Python.

My goal is the following:

I have a Goal table with a Text field that is free text.

CREATETable Goal (
    Idint,
    TextVARCHAR(5000)
);


I would like to create a procedure that returns all the entities (in the iKnow sense) in a new Entity column.

Python code, i would like to use :

5
0 350
Article Muhammad Waseem · Sep 13, 2022 5m read

Hi Community,
In this article I will demonstrate the functionality of my app iris-energy-isodata .  
Application is accessing energy data (production, demand and supply)  from the major Independent System Operators (ISOs) in the United States to ensure sustainable consumption and production patterns (SDG's 12)

Application is using python library isodata , Production EXtension PEX  along with Embedded Python.  Special Thanks to @Guillaume Rongier for the template  template for guidance

Below is the list of Independent System Operators(ISOs)

2
0 337
Article Veerarajan Karunanithi · Jul 12, 2022 10m read

Date and Time is an important factors in our life. Because all applications are engaging based on Date/Time. But our world is split into multiple time zones. if our product is launched in the world, to maintain the history of events we are definitely required to convert all times to our local time or UTC ( Coordinated Universal Time ). As I know, many known programming languages of C#, JavaScript, Java, etc., provided the library to convert the date and time. i.e with a time zone name we can be able to convert without knowing the UTC offset.

1
0 703