You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Place [callout DLL/SO](https://github.com/intersystems-ru/PythonAdapter/releases) in the `bin` folder of your InterSystems IRIS installation. Library file should be placed into a path returned by `write ##class(isc.py.Callout).GetLib()`.
7
+
2. Place [callout DLL/SO/DYLIB](https://github.com/intersystems-ru/PythonAdapter/releases) in the `bin` folder of your InterSystems IRIS installation. Library file should be placed into a path returned by `write ##class(isc.py.Callout).GetLib()`.
8
8
9
9
## Windows
10
10
11
11
3. Check that your `PYTHONHOME` environment variable points to Python 3.6.
12
12
4. Check that your SYSTEM `PATH` environment variable has `PYTHONHOME` variable (or directory it points to).
13
13
14
-
## Linux
14
+
## Linux && Mac
15
15
16
-
3. Check that your SYSTEM `PATH` environment variable has `/usr/lib`, preferably at the begining
16
+
3. Check that your SYSTEM `PATH` environment variable has `/usr/lib` and `/usr/lib/x86_64-linux-gnu`, preferably at the begining. Use `/etc/environment` file to set environment variables.
17
17
18
-
If you modified environment variables (for Windows or Linux) restart your InterSystems product.
18
+
If you modified environment variables restart your InterSystems product.
19
19
20
20
# Use
21
21
@@ -26,7 +26,7 @@ If you modified environment variables (for Windows or Linux) restart your InterS
26
26
27
27
```
28
28
set sc = ##class(isc.py.Callout).Setup()
29
-
set sc = ##class(isc.py.Callout).SimpleString("x='HELLO'", "x", , .x)
29
+
set sc = ##class(isc.py.Main).SimpleString("x='HELLO'", "x", , .x)
30
30
write x
31
31
set sc = ##class(isc.py.Callout).Finalize()
32
32
set sc = ##class(isc.py.Callout).Unload()
@@ -41,6 +41,9 @@ Generally the main interface to Python is `isc.py.Main`. It offers these methods
41
41
-`GetStatus()` - returns last occured exception in Python and clears it.
42
42
-`GetVariableJson(variable, .stream, useString)` - get JSON serialization of variable.
43
43
-`GetVariablePickle(variable, .stream, useString)` - get Pickle serialization of variable.
44
+
-`ExecuteQuery(query, variable, type)` - create resultset (pandas `dataframe` or `list`) from sql query and set it into `variable`.
45
+
-`ImportModule(module, .imported, .alias)` - import module with alias.
46
+
-`GetModuleInfo(module, .imported, .alias)` - get module alias and is it currently imported.
44
47
45
48
Possible Serializations:
46
49
-`##class(isc.py.Callout).SerializationStr` - Serialization by str() function
@@ -62,6 +65,7 @@ Interoperability adapter `isc.py.ens.Operation` offers abulity to interact with
62
65
63
66
- Execute Python code via `isc.py.msg.ExecutionRequest`. Returns `isc.py.msg.ExecutionResponse` with requested variable values
64
67
- Execute Python code via `isc.py.msg.StreamExecutionRequest`. Returns `isc.py.msg.StreamExecutionResponse` with requested variable values. Same as above, but accepts and returns streams instead of strings.
68
+
- Set dataset from SQL Query with `isc.py.msg.QueryRequest`. Returns `Ens.Response`.
65
69
- Save Python conext via `isc.py.msg.SaveRequest`. Returns `Ens.StringResponse` with context id.
66
70
- Restore Python context via `isc.py.msg.RestoreRequest`.
67
71
@@ -71,7 +75,7 @@ Check request/response classes documentation for details.
71
75
72
76
Along with callout code and Interoperability adapter there's also a test Interoperability Production and test Business Process. To use them:
73
77
74
-
1. In OS bash execute `pip install pyodbc pandas matplotlib seaborn`.
78
+
1. In OS bash execute `pip install pandas matplotlib seaborn`.
75
79
2. Execute: `do ##class(isc.py.test.CannibalizationData).Import()` to populate test data.
76
80
3. Create ODBC or JDBC connection to the namespace with data.
77
81
4. In test Business Process `isc.py.test.Process` edit annotation for `ODBC connection` or `JDBC connection` call, specifying correct DSN.
@@ -83,8 +87,9 @@ Along with callout code and Interoperability adapter there's also a test Interop
83
87
84
88
Notes.
85
89
86
-
- If you want to use JDBC connection, install JayDeBeApi: `pip install JayDeBeApi`. On linux you might need to install `apt-get install python-apt`.
90
+
- If you want to use `ODBC` connection, install pyodbc: `pip install pyodbc`.
87
91
- For ODBC on Linux insall `unixodbc unixodbc-dev python-pyodbc`.
92
+
- If you want to use `JDBC` connection, install JayDeBeApi: `pip install JayDeBeApi`. On linux you might need to install `apt-get install python-apt`.
88
93
- If you get errors similar to `undefined symbol: _Py_TrueStruct` in `isc.py.ens.Operation`operation set setting `PythonLib` to `libpython3.6m.so` or even to a full path of the shared library.
89
94
90
95
@@ -131,3 +136,18 @@ Development of C code is done in Eclipse.
131
136
4. Set environment variable `PYTHONVER` to the python version you want to build, i.e.: ` export PYTHONVER=3.6`
132
137
5. In `<Repository>/c/` execute `make`.
133
138
139
+
140
+
## Mac OS X
141
+
142
+
1. Install Python 3.6 and gcc compiler.
143
+
2. Set `GLOBALS_HOME` environment variable to the root of Caché or Ensemble installation.
144
+
3. Set environment variable `PYTHONVER` to the python version you want to build, i.e.: ` export PYTHONVER=3.6`
0 commit comments