Skip to content

Commit d05c401

Browse files
committed
embedded python demo
1 parent 15012ba commit d05c401

File tree

1 file changed

+29
-30
lines changed

1 file changed

+29
-30
lines changed

README.md

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
1-
## intersystems-objectscript-template
2-
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
43

54
## Prerequisites
65
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.
76

8-
## Installation
7+
8+
## Installation ZPM
9+
10+
```
11+
USER>zpm "install iris-python-template"
12+
```
13+
14+
## Installation docker
915

1016
Clone/git pull the repo into any local directory
1117

1218
```
13-
$ git clone https://github.com/intersystems-community/objectscript-docker-template.git
19+
$ git clone https://github.com/intersystems-community/iris-embedded-python-template.git
1420
```
1521

1622
Open the terminal in this directory and run:
@@ -25,40 +31,33 @@ $ docker-compose build
2531
$ docker-compose up -d
2632
```
2733

28-
## How to Test it
34+
## How to work with it
2935

3036
Open IRIS terminal:
3137

3238
```
3339
$ docker-compose exec iris iris session iris
34-
USER>write ##class(dc.PackageSample.ObjectScript).Test()
40+
USER>
3541
```
36-
## How to start coding
37-
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.
40-
![docker_compose](https://user-images.githubusercontent.com/2781759/76656929-0f2e5700-6547-11ea-9cc9-486a5641c51d.gif)
41-
42-
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-
4842

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+
```
5548

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+
```
5654

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:
5857

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
6061
61-
### .vscode/launch.json
62-
Config file if you want to debug with VSCode ObjectScript
62+
```
6363

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

Comments
 (0)