Name | iris-embedded-python-wrapper JSON |
Version |
0.2.3
JSON |
| download |
home_page | None |
Summary | Wrapper for embedded python on InterSystems IRIS |
upload_time | 2025-07-18 07:47:18 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2022 Guillaume Rongier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
iris
intersystems
python
embedded
|
VCS |
 |
bugtrack_url |
|
requirements |
build
twine
pytest
mkdocs
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# iris-embedded-python-wrapper
This is a module that wraps embedded python in the IRIS Dataplateform. It provides a simple interface to run python code in IRIS.
More details can be found in the [IRIS documentation](https://docs.intersystems.com/iris20243/csp/docbook/DocBook.UI.Page.cls?KEY=AFL_epython)
# Pre-requisites
To make use of this module, you need to have the IRIS Dataplatform installed on your machine (more details can be found [here](https://docs.intersystems.com/iris20243/csp/docbook/DocBook.UI.Page.cls?KEY=PAGE_deployment_install)).
Then you must configure the [service callin](#configuration-of-the-service-callin) to allow the python code to be executed and [set the environment variables](#environment-variables).
## Configuration of the service callin
In the Management Portal, go to System Administration > Security > Services, select %Service_CallIn, and check the Service Enabled box.
More details can be found in the [IRIS documentation](https://docs.intersystems.com/iris20243/csp/docbook/DocBook.UI.Page.cls?KEY=GEPYTHON_prereqs)
## Environment Variables
Set the following environment variables :
- IRISINSTALLDIR: The path to the IRIS installation directory
- LD_LIBRARY_PATH: The path to the IRIS library
- IRISUSERNAME: The username to connect to IRIS
- IRISPASSWORD: The password to connect to IRIS
- IRISNAMESPACE: The namespace to connect to IRIS
### For Linux and MacOS
For Linux and MacOS, you can set the environment variables as follows:
```bash
export IRISINSTALLDIR=/opt/iris
export LD_LIBRARY_PATH=$IRISINSTALLDIR/bin:$LD_LIBRARY_PATH
# for MacOS
export DYLD_LIBRARY_PATH=$IRISINSTALLDIR/bin:$DYLD_LIBRARY_PATH
# for IRIS username
export IRISUSERNAME=SuperUser
export IRISPASSWORD=SYS
export IRISNAMESPACE=USER
```
### For windows
For windows, you can set the environment variables as follows:
```bash
set IRISINSTALLDIR=C:\path\to\iris
set LD_LIBRARY_PATH=%IRISINSTALLDIR%\bin;%LD_LIBRARY_PATH%
```
Update the library path for windows
```bash
set PATH=%IRISINSTALLDIR%\bin;%PATH%
```
Set the IRIS username, password, and namespace
```bash
set IRISUSERNAME=SuperUser
set IRISPASSWORD=SYS
set IRISNAMESPACE=USER
```
### For PowerShell
For PowerShell, you can set the environment variables as follows:
```powershell
$env:IRISINSTALLDIR="C:\path\to\iris"
$env:PATH="$env:IRISINSTALLDIR\bin;$env:PATH"
$env:IRISUSERNAME="SuperUser"
$env:IRISPASSWORD="SYS"
$env:IRISNAMESPACE="USER"
```
## Installation
```bash
pip install iris-embedded-python-wrapper
```
# Usage
You can use this module in three ways:
1. Run python code in IRIS
2. Bind a virtual environment to embedded python in IRIS
3. Unbind a virtual environment from embedded python in IRIS
## Run python code in IRIS
Now you can use the module to run python code in IRIS. Here is an example:
```python
import iris
iris.system.Version.GetVersion()
```
Output:
```python
'IRIS for UNIX (Apple Mac OS X for x86-64) 2024.3 (Build 217U) Thu Nov 14 2024 17:29:23 EST'
```
## Bind a virtual environment to embedded python in IRIS
You can also bind or unbind an virtual environment to embedded python in IRIS. Here is an example:
```bash
bind_iris
```
Output:
```bash
(.venv) demo ‹master*›$ bind_iris
INFO:iris_utils._find_libpyton:Created backup at /opt/intersystems/iris/iris.cpf.fa76423a7b924eb085911690c8266129
INFO:iris_utils._find_libpyton:Created merge file at /opt/intersystems/iris/iris.cpf.python_merge
up IRIS 2024.3.0.217.0 1972 /opt/intersystems/iris
Username: SuperUser
Password: ***
IRIS Merge of /opt/intersystems/iris/iris.cpf.python_merge into /opt/intersystems/iris/iris.cpf
IRIS Merge completed successfully
INFO:iris_utils._find_libpyton:PythonRuntimeLibrary path set to /usr/local/Cellar/python@3.11/3.11.10/Frameworks/Python.framework/Versions/3.11/Python
INFO:iris_utils._find_libpyton:PythonPath set to /demo/.venv/lib/python3.11/site-packages
INFO:iris_utils._find_libpyton:PythonRuntimeLibraryVersion set to 3.11
```
You may have to put your admin credentials to bind the virtual environment to the embedded python in IRIS.
In windows, you must restart the IRIS.
## Unbind a virtual environment from embedded python in IRIS
```bash
unbind_iris
```
Output:
```bash
(.venv) demo ‹master*›$ unbind_iris
INFO:iris_utils._find_libpyton:Created merge file at /opt/intersystems/iris/iris.cpf.python_merge
up IRIS 2024.3.0.217.0 1972 /opt/intersystems/iris
Username: SuperUser
Password: ***
IRIS Merge of /opt/intersystems/iris/iris.cpf.python_merge into /opt/intersystems/iris/iris.cpf
IRIS Merge completed successfully
INFO:iris_utils._find_libpyton:PythonRuntimeLibrary path set to /usr/local/Cellar/python@3.11/3.11.10/Frameworks/Python.framework/Versions/3.11/Python
INFO:iris_utils._find_libpyton:PythonPath set to /Other/.venv/lib/python3.11/site-packages
INFO:iris_utils._find_libpyton:PythonRuntimeLibraryVersion set to 3.11
```
# Troubleshooting
You may encounter the following error, here is how to fix them.
## No module named 'pythonint'
This can occur when the environment variable `IRISINSTALLDIR` is not set correctly. Make sure that the path is correct.
## IRIS_ACCESSDENIED (-15)
This can occur when the service callin is not enabled. Make sure that the service callin is enabled.
## IRIS_ATTACH (-21)
This can occur when the user is not the same as the iris owner. Make sure that the user is the same as the iris owner.
## irisbuiltins.SQLError: <UNIMPLEMENTED>ddtab+82^%qaqpsq
This error can occur when the required libraries are not found. You can fix this by copying the necessary libraries to the Python framework directory:
```bash
cp /opt/intersystems/iris/bin/libicudata.69.dylib /usr/local/Cellar/python@3.11/3.11.13/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/
cp /opt/intersystems/iris/bin/libicuuc.69.dylib /usr/local/Cellar/python@3.11/3.11.13/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/
```
Raw data
{
"_id": null,
"home_page": null,
"name": "iris-embedded-python-wrapper",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "iris, intersystems, python, embedded",
"author": null,
"author_email": "grongier <guillaume.rongier@intersystems.com>",
"download_url": "https://files.pythonhosted.org/packages/25/99/338f5ec4221e30d77bf121698e5c19787596418742d3cf0601cdf8731de0/iris_embedded_python_wrapper-0.2.3.tar.gz",
"platform": null,
"description": "# iris-embedded-python-wrapper\n\nThis is a module that wraps embedded python in the IRIS Dataplateform. It provides a simple interface to run python code in IRIS.\n\nMore details can be found in the [IRIS documentation](https://docs.intersystems.com/iris20243/csp/docbook/DocBook.UI.Page.cls?KEY=AFL_epython)\n\n# Pre-requisites\n\nTo make use of this module, you need to have the IRIS Dataplatform installed on your machine (more details can be found [here](https://docs.intersystems.com/iris20243/csp/docbook/DocBook.UI.Page.cls?KEY=PAGE_deployment_install)).\n\nThen you must configure the [service callin](#configuration-of-the-service-callin) to allow the python code to be executed and [set the environment variables](#environment-variables).\n\n## Configuration of the service callin\n\nIn the Management Portal, go to System Administration > Security > Services, select %Service_CallIn, and check the Service Enabled box.\n\nMore details can be found in the [IRIS documentation](https://docs.intersystems.com/iris20243/csp/docbook/DocBook.UI.Page.cls?KEY=GEPYTHON_prereqs)\n\n## Environment Variables\n\nSet the following environment variables :\n\n- IRISINSTALLDIR: The path to the IRIS installation directory\n- LD_LIBRARY_PATH: The path to the IRIS library\n- IRISUSERNAME: The username to connect to IRIS\n- IRISPASSWORD: The password to connect to IRIS\n- IRISNAMESPACE: The namespace to connect to IRIS\n\n### For Linux and MacOS\n\nFor Linux and MacOS, you can set the environment variables as follows:\n\n```bash\nexport IRISINSTALLDIR=/opt/iris\nexport LD_LIBRARY_PATH=$IRISINSTALLDIR/bin:$LD_LIBRARY_PATH\n# for MacOS\nexport DYLD_LIBRARY_PATH=$IRISINSTALLDIR/bin:$DYLD_LIBRARY_PATH\n# for IRIS username\nexport IRISUSERNAME=SuperUser\nexport IRISPASSWORD=SYS\nexport IRISNAMESPACE=USER\n```\n\n### For windows\n\nFor windows, you can set the environment variables as follows:\n \n```bash\nset IRISINSTALLDIR=C:\\path\\to\\iris\nset LD_LIBRARY_PATH=%IRISINSTALLDIR%\\bin;%LD_LIBRARY_PATH%\n```\n\nUpdate the library path for windows\n\n```bash\nset PATH=%IRISINSTALLDIR%\\bin;%PATH%\n```\n\nSet the IRIS username, password, and namespace\n\n```bash\nset IRISUSERNAME=SuperUser\nset IRISPASSWORD=SYS\nset IRISNAMESPACE=USER\n```\n\n### For PowerShell\n\nFor PowerShell, you can set the environment variables as follows:\n\n```powershell\n$env:IRISINSTALLDIR=\"C:\\path\\to\\iris\"\n$env:PATH=\"$env:IRISINSTALLDIR\\bin;$env:PATH\"\n$env:IRISUSERNAME=\"SuperUser\"\n$env:IRISPASSWORD=\"SYS\"\n$env:IRISNAMESPACE=\"USER\"\n```\n\n## Installation \n\n```bash\npip install iris-embedded-python-wrapper\n```\n\n# Usage\n\nYou can use this module in three ways:\n\n1. Run python code in IRIS\n2. Bind a virtual environment to embedded python in IRIS\n3. Unbind a virtual environment from embedded python in IRIS\n\n## Run python code in IRIS\n\nNow you can use the module to run python code in IRIS. Here is an example:\n\n```python\nimport iris\niris.system.Version.GetVersion()\n```\n\nOutput:\n\n```python\n'IRIS for UNIX (Apple Mac OS X for x86-64) 2024.3 (Build 217U) Thu Nov 14 2024 17:29:23 EST'\n```\n\n## Bind a virtual environment to embedded python in IRIS\n\nYou can also bind or unbind an virtual environment to embedded python in IRIS. Here is an example:\n\n```bash\nbind_iris\n```\n\nOutput:\n\n```bash\n(.venv) demo \u2039master*\u203a$ bind_iris\nINFO:iris_utils._find_libpyton:Created backup at /opt/intersystems/iris/iris.cpf.fa76423a7b924eb085911690c8266129\nINFO:iris_utils._find_libpyton:Created merge file at /opt/intersystems/iris/iris.cpf.python_merge\nup IRIS 2024.3.0.217.0 1972 /opt/intersystems/iris\n\nUsername: SuperUser\nPassword: ***\nIRIS Merge of /opt/intersystems/iris/iris.cpf.python_merge into /opt/intersystems/iris/iris.cpf\nIRIS Merge completed successfully\nINFO:iris_utils._find_libpyton:PythonRuntimeLibrary path set to /usr/local/Cellar/python@3.11/3.11.10/Frameworks/Python.framework/Versions/3.11/Python\nINFO:iris_utils._find_libpyton:PythonPath set to /demo/.venv/lib/python3.11/site-packages\nINFO:iris_utils._find_libpyton:PythonRuntimeLibraryVersion set to 3.11\n```\n\nYou may have to put your admin credentials to bind the virtual environment to the embedded python in IRIS.\n\nIn windows, you must restart the IRIS.\n\n## Unbind a virtual environment from embedded python in IRIS\n\n```bash\nunbind_iris\n```\n\nOutput:\n\n```bash\n(.venv) demo \u2039master*\u203a$ unbind_iris\nINFO:iris_utils._find_libpyton:Created merge file at /opt/intersystems/iris/iris.cpf.python_merge\nup IRIS 2024.3.0.217.0 1972 /opt/intersystems/iris\n\nUsername: SuperUser\nPassword: ***\nIRIS Merge of /opt/intersystems/iris/iris.cpf.python_merge into /opt/intersystems/iris/iris.cpf\nIRIS Merge completed successfully\nINFO:iris_utils._find_libpyton:PythonRuntimeLibrary path set to /usr/local/Cellar/python@3.11/3.11.10/Frameworks/Python.framework/Versions/3.11/Python\nINFO:iris_utils._find_libpyton:PythonPath set to /Other/.venv/lib/python3.11/site-packages\nINFO:iris_utils._find_libpyton:PythonRuntimeLibraryVersion set to 3.11\n```\n\n# Troubleshooting\n\nYou may encounter the following error, here is how to fix them.\n\n## No module named 'pythonint'\n\nThis can occur when the environment variable `IRISINSTALLDIR` is not set correctly. Make sure that the path is correct.\n\n## IRIS_ACCESSDENIED (-15)\n\nThis can occur when the service callin is not enabled. Make sure that the service callin is enabled.\n\n## IRIS_ATTACH (-21)\n\nThis can occur when the user is not the same as the iris owner. Make sure that the user is the same as the iris owner.\n\n## irisbuiltins.SQLError: <UNIMPLEMENTED>ddtab+82^%qaqpsq\n\nThis error can occur when the required libraries are not found. You can fix this by copying the necessary libraries to the Python framework directory:\n\n```bash\ncp /opt/intersystems/iris/bin/libicudata.69.dylib /usr/local/Cellar/python@3.11/3.11.13/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/\ncp /opt/intersystems/iris/bin/libicuuc.69.dylib /usr/local/Cellar/python@3.11/3.11.13/Frameworks/Python.framework/Versions/3.11/Resources/Python.app/Contents/MacOS/\n```\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2022 Guillaume Rongier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Wrapper for embedded python on InterSystems IRIS",
"version": "0.2.3",
"project_urls": {
"documentation": "https://github.com/grongierisc/iris-embedded-python-wrapper/blob/master/README.md",
"homepage": "https://github.com/grongierisc/iris-embedded-python-wrapper",
"issues": "https://github.com/grongierisc/iris-embedded-python-wrapper/issues",
"repository": "https://github.com/grongierisc/iris-embedded-python-wrapper"
},
"split_keywords": [
"iris",
" intersystems",
" python",
" embedded"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6c7a7577bf14316b0778bed5501114eb4990b820c8f8667018dd90ecde48837e",
"md5": "2829053be615dca7880e3452db0a8f59",
"sha256": "8a1e6036ef9ef08162bc908f29628de84685c18c62c3b38a401904b91d1da099"
},
"downloads": -1,
"filename": "iris_embedded_python_wrapper-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2829053be615dca7880e3452db0a8f59",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 16224,
"upload_time": "2025-07-18T07:47:17",
"upload_time_iso_8601": "2025-07-18T07:47:17.175698Z",
"url": "https://files.pythonhosted.org/packages/6c/7a/7577bf14316b0778bed5501114eb4990b820c8f8667018dd90ecde48837e/iris_embedded_python_wrapper-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2599338f5ec4221e30d77bf121698e5c19787596418742d3cf0601cdf8731de0",
"md5": "14e45c52ff9b85778473e50267039953",
"sha256": "c061e33328a36593ec4390799f6e85e25bbc7ae3613337a5cb91e20c533c0e93"
},
"downloads": -1,
"filename": "iris_embedded_python_wrapper-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "14e45c52ff9b85778473e50267039953",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 16636,
"upload_time": "2025-07-18T07:47:18",
"upload_time_iso_8601": "2025-07-18T07:47:18.879732Z",
"url": "https://files.pythonhosted.org/packages/25/99/338f5ec4221e30d77bf121698e5c19787596418742d3cf0601cdf8731de0/iris_embedded_python_wrapper-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-18 07:47:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "grongierisc",
"github_project": "iris-embedded-python-wrapper",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "build",
"specs": []
},
{
"name": "twine",
"specs": []
},
{
"name": "pytest",
"specs": []
},
{
"name": "mkdocs",
"specs": []
}
],
"lcname": "iris-embedded-python-wrapper"
}