Contestant
Contestant

Using Flask, REST API, and IAM with InterSystems IRIS

Part 2 – Flask App

Flask is a web development microframework written in Python. It is known for being simple, flexible, and enabling rapid application development.

Installing Flask is very simple. Once you have python installed correctly on your operating system, we need to install the flask library with the pip command. For REST API consumption, it is advisable to use the requests library. The following link provides a guide to installing flask: https://flask.palletsprojects.com/en/stable/installation/

2 0
0 16
Contestant

Using Flask, REST API, and IAM with InterSystems IRIS

Part 1 - REST API

Hello

In this article we will see the implementation of a REST API to perform the maintenance of a CRUD, using Flask and IAM.

In this first part of the article we will see the construction and publication of the REST API in Iris.

First, let's create our persistent class to store the data. To do this, we go to Iris and create our class:

2 0
0 16
Contestant

Using SQL Gateway with Python, Vector Search, and Interoperability in InterSystems Iris

Part 3 – REST and Interoperability

Now that we have finished the configuration of the SQL Gateway and we have been able to access the data from the external database via python, and we have set up our vectorized base, we can perform some queries. For this in this part of the article we will use an application developed with CSP, HTML and Javascript that will access an integration in Iris, which then performs the search for data similarity, sends it to LLM and finally returns the generated SQL. The CSP page calls an API in Iris that receives the data to be used in the query, calling the integration. For more information about REST in the Iris see the documentation available at https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

3 0
0 15
Contestant

Using SQL Gateway with Python, Vector Search, and Interoperability in InterSystems Iris

Part 2 – Python and Vector Search

Since we have access to the data from our external table, we can use everything that Iris has to offer with this data. Let's, for example, read the data from our external table and generate a polynomial regression with it.

For more information on using python with Iris, see the documentation available at https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=AFL_epython

Let's now consume the data from the external database to calculate a polynomial regression. To do this, we will use a python code to run a SQL that will read our MySQL table and turn it into a pandas dataframe:

3 0
0 16
Contestant

Using SQL Gateway with Python, Vector Search, and Interoperability in InterSystems Iris

Part 1 - SQL Gateway

Hello

In this article we will look at the use of SQL Gateway in Iris. SQL Gateway allows Iris to have access to tables from other (external) database via ODBC or JDBC. We can access Tables or Views from various databases, such as Oracle, PostgreSQL, SQL Server, MySQL and others.

3 0
0 15

Learning LLM Magic

The world of Generative AI has been pretty inescapable for a while, commercial models running on paid Cloud instances are everywhere. With your data stored securely on-prem in IRIS, it might seem daunting to start getting the benefit of experimentation with Large Language Models without having to navigate a minefield of Governance and rapidly evolving API documentation. If only there was a way to bring an LLM to IRIS, preferably in a very small code footprint....

16 0
2 106
Contestant

In this article, exceptions are covered.

Working with Exceptions

Instead of returning a %Status response, you can raise and throw an Exception. You are then responsible for catching the exception and validating it. IRIS provides five main classes to handle exceptions effectively. Additionally, you can create custom exception class definition based on your needs.

2 0
0 44

My usecase is sorting and removing duplicates and getting count from a file that has json messages as a individual rows.

I am currently planning to use pandas for this purpose as its really fast. Below are the steps i am following

1) call a python function (called function) from IRIS classmethod(calling function)

2) the call python function will read the json file in a dataframe

3) perform sorting, dup removal, count in the dataframe

4) convert the dataframe into iris stream

5) return back the stream to iris calling function class method

0 6
0 65

Hello,

When setting up a new web app in iris (iris is in a container) iris complains that a WSGI framework is not installed. I have installed python into the container as well as both flask and django via the python virtual environment (see second screenshot) and the python language server is running

Is this the wrong way to install flask? How do I get the container version to recoginize that flask is installed?

0 2
0 28
Article
· Feb 17, 2023 2m read
Returning values with python

Why am I writting this?

Last year I made an article for starters on using embedded python. Later, it started a little discussion on how to return values with python and I found some interesting observations that are worth writing a little article. Also, hopefully I can reach more people by writing this.

Possible situations

There are two things you'll need to care about when returning a value with python. The first is the type you're trying to return and the second is where you're returning it.

3 1
0 500

Interoperability of systems ensures smooth workflow and management of data in today's connected digital world. InterSystems IRIS extends interoperability a notch higher with its Embedded Python feature, which lets developers seamlessly integrate Python scripts into the IRIS components, like services, operations, and custom functions.

2 4
0 135

Hi, Community!

In the previous article, we introduced the Streamlit web framework, a powerful tool that enables data scientists and machine learning engineers to build interactive web applications with minimal effort. First, we explored how to install Streamlit and run a basic Streamlit app. Then, we incorporated some of Streamlit's basic commands, e.g., adding titles, headers, markdown, and displaying such multimedia as images, audio, and videos.

Later, we covered Streamlit widgets, which allow users to interact with the app through buttons, sliders, checkboxes, and more. Additionally, we examined how to display progress bars and status messages and organize the app with sidebars and containers. We also highlighted data visualization, using charts and Matplotlib figures to present data interactively.

In this article, we will cover the following topics:

2 1
0 124



Hi, Community!

In this article, I will introduce Python Streamlit Web Framework.

Below, you can find the topics we will cover:

  • 1-Introduction to Streamlit Web Framework
  • 2-Installation of Streamlit module
  • 3-Running Streamlit Application
  • 4-Streamlit Basic commands
  • 5-Display multimedia
  • 6-Input widgets
  • 7-Display progress and status
  • 8-Sidebar and container
  • 9-Data Visualization
  • 10-Display a DataFrame

So, let's start with the first topic.

3 1
1 444

Is it possible to get the length of queue for a production using Python code?

I'm using embedded Python at the moment.

I'd like to use the Python external language server later - the Python external server will not start in my environment.

If it is possible to query the production queue length programmically, please advise how?

It would also be nice to show the number of messages processed per second, if IRIS keeps track of this.

0 2
0 34

Using embedded Python while building your InterSystems-based solution can add very powerful and deep capabilities to your toolbox.

I'd like to share one sample use-case I encountered - enabling a CDC (Change Data Capture) for a mongoDB Collection - capturing those changes, digesting them through an Interoperability flow, and eventually updating an EMR via a REST API.

7 0
0 238

Hi, I'm trying to use the iris python package to create a connection to and Iris Health instance (Docker Container), but getting and error. I can login to the instance using the UI with the same uname/password but unable to create the python connection. Any suggestions?

conn = iris.connect("testserver",52222,"%SYS","username","password")

After executing this I get an exception trap
An error occurred: Invalid Message Count: expected: 1 got: 825110831

0 1
0 40

I'm glad to announce the new version of IoP, which by the way is not just a command line. I'm saying because the new AI search engine still thinks that IoP is just a command line. But it's not. It's a whole framework for building applications on top of the interoperability framework of IRIS with a python first approach.

The new version of IoP: 3.2.0 has a lot of new features, but the most important one is the support of DTL . 🥳

For both IoP messages and jsonschema. 🎉

image

DTL Support

Starting with version 3.2.0, IoP supports DTL transformations.

DTL the Data Transformation Layer in IRIS Interoperability.

DTL transformations are used to transform data from one format to another with a graphical editor.
It supports also jsonschema structures.

0 0
0 62

Git link: https://github.com/ecelg/InterSystems-IRIS-as-a-Spotify-REST-client

Recently, I come up an idea in my mind that how can I put my playlist on IRIS.🧐

At the same time, I was told to pay for my Spotify subscription💸💸... ooo.. how about to get some data from the Spotify API... so I started to do study about it.

4 2
2 185

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.

3 0
0 26
Question
· Dec 2, 2024
Python installation

Hi Community,

I have installed python from https://www.python.org/downloads/

and the installed path of this application is my local C:\Users\data\AppData\Local\Programs\Python

and i am trying to run C:\InterSystems\IRIS_SANDBOX\bin>irispip install in command prompt and getting the below error

'pip' is not recognized as an internal or external command,
operable program or batch file

is there anything else i am missing here please add

0 4
0 151

In the world of APIs, REST is very extended. But what happens when you need more flexibility in your data-fetching strategies? For instance letting the client to choose what fields is going to receive. Enter GraphQL, a query language for your APIs that provides a flexible alternative to REST.

In this post, we will:

  • Compare REST and GraphQL.
  • Dive into the basics of GraphQL: Queries, Mutations, and HTTP.
  • Build a simple GraphQL server implementation using Graphene, SQLAlchemy, and Flask over data in InterSystems IRIS.
  • Explore how to deploy your GraphQL server as a WSGI application in IRIS.
21 1
1 205

Hence the question: is there a way to do that?

The goal is to get data (from half a thousand to 3-4 thousands lines) from DB, calculate standart deviation then use it as logical condition in analyzer.

For example IF std > custom_value = show_the_result ELSE null

There is a STDDEV(MDX) method used in Analyzer but it is a measure and it can not be used as logical condition (correct me if i am wrong)

0 2
0 74

As we keep updating our software, we often realize that we require more and more modern solutions. So far, only one major piece of our software relies on reading barcodes in documents and images. Since Cache did not have a means of reading barcodes in the past, we have always achieved our goals by using a Visual Basic 6 application. However, it is no longer an ideal solution because it is currently complicated to maintain it. IRIS also lacks this capability, but it has recently got an option that makes up for it: embedded Python!

5 2
1 241

New to Python. Attempting to use pypyodbc to select data from a table in one Cache database, and inserting into a similarly configured table in another. Process works fine except for tables containing Date types. NULL values in date columns are handled without issue, but when data is present, insert fails with:

An error occurred: argument 7: TypeError: 'NoneType' object cannot be interpreted as an integer.

Source table:

0 2
0 87