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
This is a template for InterSystems ObjectScript Github repository.
3
-
The template goes also with a few files which let you immedietly compile your ObjecScript files in InterSystems IRIS Community Edition in a docker container
1
+
## iris-embedded-python-template
2
+
This is a template to work with Embedded Python in InterSystems IRIS
4
3
5
4
## Prerequisites
6
5
Make sure you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Docker desktop](https://www.docker.com/products/docker-desktop) installed.
This repository is ready to code in VSCode with ObjectScript plugin.
38
-
Install [VSCode](https://code.visualstudio.com/), [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) and [ObjectScript](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript) plugin and open the folder in VSCode.
39
-
Open /src/cls/PackageSample/ObjectScript.cls class and try to make changes - it will be compiled in running IRIS docker container.
Feel free to delete PackageSample folder and place your ObjectScript classes in a form
43
-
/src/Package/Classname.cls
44
-
[Read more about folder setup for InterSystems ObjectScript](https://community.intersystems.com/post/simplified-objectscript-source-folder-structure-package-manager)
45
-
46
-
The script in Installer.cls will import everything you place under /src into IRIS.
47
-
48
42
49
-
## What's inside the repository
50
-
51
-
### Dockerfile
52
-
53
-
The simplest dockerfile which starts IRIS and imports code from /src folder into it.
54
-
Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders.
43
+
The first test demonstrates the call to a standard python library working with dates datetime
44
+
```
45
+
USER>d ##class(dc.python.test).Today()
46
+
2021-02-09
47
+
```
55
48
49
+
Another example shows the work of a custom lib sample.py which is installed with repo or ZPM. It has function hello which returns string "world":
50
+
```
51
+
USER>d ##class(dc.python.test).Hello()
52
+
World
53
+
```
56
54
57
-
### .vscode/settings.json
55
+
Another example shows how to work with files and use pandas and numpy libs.
56
+
It calculates the mean age of Titanic passengers:
58
57
59
-
Settings file to let you immedietly code in VSCode with [VSCode ObjectScript plugin](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript))
58
+
```
59
+
USER>d ##class(dc.python.test).TitanicMeanAge()
60
+
mean age=29.69911764705882
60
61
61
-
### .vscode/launch.json
62
-
Config file if you want to debug with VSCode ObjectScript
62
+
```
63
63
64
-
[Read about all the files in this artilce](https://community.intersystems.com/post/dockerfile-and-friends-or-how-run-and-collaborate-objectscript-projects-intersystems-iris)
0 commit comments