Could you please help anyone how to import Python package in %SYSTEM package and to use python methods to write in object script class?

I used the following link to install the Python but I can't see the Python package in %SYSTEM package and my program throwing the Class Does not exist error?

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

Please help on this..

0 5
0 286

I am in the process of creating a python report writer that includes the information contained in "License Usage" page of the management portal. I think I have a handle on the local values contained in the report using the %SYSTEM.License class I have those defined using these methods:

Current License Units Used - -> LUConsumed

Maximum License Units Used --> LUMaxConsumed

License Units Enforced --> KeyEnforcedUnits

License Units Authorized --> KeyLicenseUnits

0 5
0 280

Hi all,
I am trying to execute a query like the below code.
set statement = ##class(%ResultSet).%New("some_class:query_method"). // here query method is empty and with rowspec some columname

statement.Execute(param1)

I want to fetch data type of column value returned from above. eg - Name - VARCHAR, amount - INTEGER etc.
How can I get it. Or if not possible directly. Is there any other way to validate or get datatype of values returned. Line we have type() in python3

0 5
0 274

I have an existing Python script that opens a child session using the pexpect library. But currently all it does is send hard-coded commands to the Cache process and expect a hard-coded response back in order to continue in the script.

I would like to run a Cache routine from the script, pass in a parameter, and wait for a response that will be different every time (a date, in this case). So the call would be something like D $$Tag^Routine(parameter) and wait for the routine to complete and return the response.

0 3
0 260

Hello there community,

I am pleased to say that i have started building a product and I have chosen InterSystems technology to be used in it.

But I have a confusion with regard to it.

I actually have to come to a conclusion to whether to use CACHE or IRIS.

I will be using a lot of data and also integrating it along with Python for DEEP and Machine Learning.

Also I do not have an idea of how to get the licensed version of either of that.

0 3
1 253

I'm after some more in-depth information about how the embedded python is implemented with regards to how it works when a python method is called from a CSP page. Will it run in the same Windows process? Will there be any issues with multitasking (considering python doesn't seem very good at this)?

Also, is there a performance penalty to pay for running embedded python vs "using IRIS APIs from Python".

Another question is what python interpreter the embedded python is using? Is it an Intersystems one or the regular c.python? Version?

Excited to go Python!

0 2
0 252
Question
· Nov 4, 2021
IRIS Language Bridge Python

At the recent virtual conference I saw the demonstration on being able to run Python within ObjectScript and run ObjectScript within Python thanks to a feature called Language Bridge. Is this available now? If so, am I able to install it? I am currently running HealthShare 2020.1. I have a little bit of experience using Irisnative with Python but was intrigued with the more seamless-looking features offered by the Language Bridge.

Thanks for any insight.

Marlin Mixon

1 5
0 251

I am writing a Python tools I want to access the %Monitor.System.License properties:

  1. AvailableDist
  2. AvailableLocal
  3. MaxUsedDist
  4. MaxUsedLocal
  5. CurrentUsedDist
  6. CurrentUsedLocal

Initially I want to develop Objectscript to verify access to the properties. But I can not figure the proper syntax.

I first attempted:

set ans = ##class(%Monitor.System.License).AvailableDist

which failed.

I tried another approach:

set ans = ##CLASS(%Monitor.System.License).%GetParameter("AvailableLocal")

0 2
0 250

Hi folks!

How can I refer to a classmethod of the same class while coding another classmethod with Embedded python?

I know that I can call it with iris.cls(classname).MethodName(), but it's more cumbersome even comparing with ObjectScript, where I can call ..MethodName().

Compare ObjectScript:

do ..SetupGame()

and the same call in EmbeddedPython:

    iris.cls('eshvarov.sample.SeaBattle.GamePython').SetupGame()

Thoughts?

0 6
0 246

I have a simple python script to pull table information from cache 2018.1.2 which is on a windows 10 machine. I get no results though the same query in the management portal works correctly:

import os
import sys
import intersys.pythonbind3 as ipyb
import numpy as np

# Connect to the Cache' database
url = "localhost[1972]:%SYS"
user = "xxxx"
password = "zzzzz"

accessKey = (url, user, password)

def main(accessKey):

0 8
0 231

I have a python script that is pulling the cache instance key expiration date ( KeyExpirationDate() ) which comes back as an integer. With the queryscript function - $ZDATE(73284) I can derive the actual expiration date. Is there a manner or method of creating an equivalent Python script that will convert the integer return by the KeyExpirationDate() method into a date string?

0 1
1 231
Question
· Nov 11, 2020
Create Database using Python
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?

0 3
0 229

I was interested in accessing IRIS (Healthshare) using Python. I found instructions how to this here: https://github.com/intersystems/quickstarts-python/tree/master/Solutions...

The installation went well using pip and when python executes "import irisnative" it works fine. It just fails with a connection timeout when I try "irisnative.createConnection(...)." Below is my code:

0 3
0 223
Question
· Jul 28, 2023
IRISPIP Cryptodome C++ Error

Hello,

I need AES ECB with PKSC7 padding for an interface.
Unfortunately, the %SYSTEM.Encryption.AESEncode cannot do this.

Therefore I wanted to include the following python lib.
PyCrptydome -> https://pycryptodome.readthedocs.io/en/latest/index.html

We need to install the package offline on the system. So I downloaded it and put it in the MGR/Python/ directory.

However, when I try to install it, I get the following error message:

0 11
0 204
Question
· Oct 27, 2020
Configure IRIS using Python

I am trying to configure IRIS using python. The first task I wanted to do it change the journal directory. I cannot figure out the right way to work with the Config.Journal class with python. I can get the text to query the current setting.

returnValue = dbnative.classMethodValue("Config.Journal","GetList")
print(returnValue )

But I don't see a straightforward way to parse the $List returned by GetList() I was hoping there was an easier way.

How do I

1. Query configuration parameters?

2. Set configuration parameters?

Using python?

0 2
0 203

All,

I've asked my teammate to open a WRC on this issue, but wanted to open the discussion to see if maybe we aren't the first people to see this issue.

The code we are deploying is a COS object with some Python methods. The code works fine locally on the developer's machine. However, when the business process runs in the server environment, we see the following when COS code attempts to call a [Language = python] method:

0 5
0 199

I am writing a Python tool to query our cache instances for various information. I have set up the connection without issue:

import intersys.pythonbind3 as pyb

conn = pyb.connection()
conn.connect_now(.....)

db = pyb.database(conn)
qry = pyb.query(db)
obj = pyb.object(db)

I wanted to make the call:

execRes = qry.prepare_class("SYS.Database",'FreeSpace')

But fetching fails because of data mismatches ( as I understand from other posts) and my testing bears out this type of failure.

0 6
0 190

Is there a way to automatically transform Object Script arrays to Python lists? This code results in a list of arrays

Iter0 =  dbnative.iterator("HS.Data.OIDMapD")
for subscript, value in Iter0.items():
    print(f"subscript={subscript}, value={value}")

Here is the result:

subscript=1, value=2.16.840.1.113883.3.86ISCInterSystems Corporation

I suppose it would be too hard to parse this into a list, I was just wondering if there was a function provided to make it convenient and proper.

Thanks,

Marlin Mixon

0 2
0 181

So, I know that I can return a SQL Error message from my SQL Procedure written in ObjectScript, with code like this

$ cat <<EOF | irissqlcli iris://_SYSTEM:SYS@localhost:1972/USER
CREATE or REPLACE PROCEDURE test()
LANGUAGE OBJECTSCRIPT
{
 SET %sqlcontext.%SQLCODE = 400
 SET %sqlcontext.%ROWCOUNT = -1
 SET %sqlcontext.%Message = "test error message"
};

CALL test();

EOF
[SQLCODE: <-400>:<Fatal error occurred>]
[Location: <SPFunction>]
[%msg: <test error message>]

But I did not find how to do it with Python. I can't find %sqlcontext variable available there

0 1
0 160

Hello,

I believe that the Perl and Python bindings that exist on Cache / Ensemble do not exist on IRIS for Health 2020.1 ... is that correct?

Is there any similar documentation and samples (like below) , that show an example of how to run a basic Perl or Python script that connects with ODBC or whatever the recommended way?

http://docs.intersystems.com/cache20102/csp/docbook/DocBook.UI.Page.cls?...

0 6
0 149

Hi everyone,

I'm attempting to compile a basic Python code on a remote server, but it appears that the compiler doesn't recognize the language.

The remote server is running a virtual machine with Oracle Linux Server 7.9 (64-bit), and it has IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2021.1 (Build 215U) [HealthConnect:3.3.0] installed.

When I try to compile a script that includes a Python ClassMethod, such as this "testpy.cls":

0 4
0 139