NOTE: This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
pip install https://github.com/intersystems-community/intersystems-irispython/releases/download/3.5.0/intersystems_iris-3.5.0-py3-none-any.whl
Connect to IRIS over network
import intersystems_iris.dbapi._DBAPI as dbapi
config = {
"hostname": "localhost",
"port": 1972,
"namespace": "USER",
"username": "_SYSTEM",
"password": "SYS",
}
with dbapi.connect(**config) as conn:
with conn.cursor() as cursor:
cursor.execute("select ? as one, 2 as two", 1) # second arg is parameter value
for row in cursor:
one, two = row
print(f"one: {one}")
print(f"two: {two}")
Connect to IRIS using embedded python mode. %Service_CallIn
have to be enabled in IRIS
import intersystems_iris.dbapi._DBAPI as dbapi
config = {
"embedded": True,
"namespace": "USER",
}
with dbapi.connect(**config) as conn:
with conn.cursor() as cursor:
sql = "select ? as one, ? as two union all select ?, ?"
params = [1, 2, 3, 4]
cursor.execute(sql, params)
for row in cursor:
one, two = row
print(f"one: {one}")
print(f"two: {two}")
This project already used by several projects
- SQLAlchemy-IRIS dialect for SQLAlchemy framework. Which Can be used in Pandas, Flask and many other libraries
- Django-IRIS driver for Django full-stack framework
- dbt-iris plugin to DBT to make ELT possible with IRIS