InterSystems IRIS® data platform supports two lightweight Python APIs that provide direct access to InterSystems IRIS databases via relational tables or multidimensional storage:
Watch the video to review ways to connect your application to InterSystems IRIS data platform, or follow the steps in the exercise below to use PyODBC and the Native API for Python to connect to InterSystems IRIS.
In the steps below, you will access a set of sample stock data using each of the ways described. With Python, you can interact with InterSystems IRIS relationally (with PyODBC) or natively (with the Native API). Note: The sample code and supporting wheel files only support Python 3.
cd /home/project git clone -b try-iris http://github.com/intersystems/quickstarts-python
connection.config
file and change the value of IP
to -- cannot display value - please provision a sandbox and the value of port
to -- cannot display value - please provision a sandbox.cd /home/project/quickstarts-python/Solutions pip install nativeAPI_wheel/irisnative-1.0.0-cp34-abi3-linux_x86_64.whl
If installed successfully, you should see the following message: Successfully installed irisnative-1.0.0
cd /home/project/quickstarts-python/Solutions sudo odbcinst -i -d -f pyodbc_wheel/odbcinst.ini
If installed successfully, you should see the following message: odbcinst: Driver installed. Usage count increased to 1.
Use the Native API to store to a custom structure and call methods or routines.
nativeAPIConnectToIRIS.py
to see how to connect to InterSystems IRIS using the Native API.python nativeAPIConnectToIRIS.py
nativeAPIFullApp.py
.python nativeAPIFullApp.py
Use the standard PyODBC for SQL-based access to relational tables.
pyodbcConnectToIRIS.py
to see how to connect to InterSystems IRIS using PyODBC.python pyodbcConnectToIRIS.py
python pyodbcFullApp.py
To give you the best possible experience, this site uses cookies and by continuing to use the site you agree that we can save them on your device.