|
8 | 8 |
|
9 | 9 | Welcome to the **Interoperability On Python (IoP)** proof of concept! This project demonstrates how the **IRIS Interoperability Framework** can be utilized with a **Python-first approach**. |
10 | 10 |
|
| 11 | +Documentation can be found [here](https://grongierisc.github.io/interoperability-embedded-python/). |
| 12 | +For prompt-driven workflows, see [AI-assisted coding with IoP](https://grongierisc.github.io/interoperability-embedded-python/ai-coding/). |
| 13 | +For task-oriented examples, see the [IoP cookbooks](https://grongierisc.github.io/interoperability-embedded-python/cookbooks/). |
| 14 | +For application repositories, start from the [reusable AGENTS.md template](https://grongierisc.github.io/interoperability-embedded-python/agents-template/). |
| 15 | + |
11 | 16 | ## Example |
12 | 17 |
|
13 | | -Here's a simple example of how a Business Operation can be implemented in Python: |
| 18 | +Here's a tiny Python-authored production: |
14 | 19 |
|
15 | 20 | ```python |
16 | | -from iop import BusinessOperation |
| 21 | +from dataclasses import dataclass |
17 | 22 |
|
18 | | -class MyBo(BusinessOperation): |
19 | | - def on_message(self, request): |
20 | | - self.log_info("Hello World") |
21 | | -``` |
| 23 | +from iop import BusinessOperation, Message, PollingBusinessService, Production, target |
22 | 24 |
|
23 | | -## Installation |
24 | 25 |
|
25 | | -To start using this proof of concept, install it using pip: |
| 26 | +@dataclass |
| 27 | +class HelloRequest(Message): |
| 28 | + text: str = "Hello World" |
26 | 29 |
|
27 | | -```bash |
28 | | -pip install iris-pex-embedded-python |
29 | | -``` |
30 | 30 |
|
31 | | -with zpm/ipm: |
| 31 | +class HelloService(PollingBusinessService): |
| 32 | + Output = target() |
32 | 33 |
|
33 | | -install zpm : |
| 34 | + def on_poll(self): |
| 35 | + self.send_request_async(self.Output, HelloRequest()) |
34 | 36 |
|
35 | | -```objectscript |
36 | | -set r = ##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/0.9.0/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") |
37 | | -``` |
38 | 37 |
|
39 | | -Then install the package: |
| 38 | +class HelloOperation(BusinessOperation): |
| 39 | + def on_message(self, request: HelloRequest): |
| 40 | + self.log_info(request.text) |
| 41 | + return request |
| 42 | + |
40 | 43 |
|
41 | | -```objectscript |
42 | | -zpm "install pex-embbeded-python" |
| 44 | +prod = Production("HelloWorld.Production", testing_enabled=True) |
| 45 | +service = prod.service("HelloService", HelloService) |
| 46 | +operation = prod.operation("HelloOperation", HelloOperation) |
| 47 | +service.connect(HelloService.Output, operation) |
| 48 | + |
| 49 | +PRODUCTIONS = [prod] |
43 | 50 | ``` |
44 | 51 |
|
| 52 | +## Installation |
45 | 53 |
|
46 | | -## Getting Started |
| 54 | +To start using this proof of concept, install it using pip: |
47 | 55 |
|
48 | | -If you're new to this proof of concept, begin by reading the [installation guide](getting-started/installation.md). Then, follow the [first steps](getting-started/first-steps.md) to create your first Python-authored production. |
| 56 | +```bash |
| 57 | +pip install iris-pex-embedded-python |
| 58 | +``` |
| 59 | + |
| 60 | +## Getting Started |
49 | 61 |
|
50 | | -If you are using an AI coding assistant, start with [AI-assisted coding with IoP](ai-coding.md). |
51 | | -For concrete workflows, use the [IoP cookbooks](cookbooks/index.md). |
52 | | -For application repositories, copy the [reusable AGENTS.md template](agents-template.md). |
53 | | -For healthcare productions, also see [Healthcare AI-assisted coding](healthcare-ai-coding.md). |
| 62 | +If you're new to this project, begin by reading the [installation guide](https://grongierisc.github.io/interoperability-embedded-python/getting-started/installation). Then, follow the [first steps](https://grongierisc.github.io/interoperability-embedded-python/getting-started/first-steps) to create your first Python-authored production. |
54 | 63 |
|
55 | | -For the Pythonic production graph model, see [Production Graph](production-graph.md). |
56 | | -For safe changes to existing IRIS productions, see the [production change workflow](production-change-workflow.md). |
| 64 | +If you are using an AI coding assistant, start with [AI-assisted coding with IoP](https://grongierisc.github.io/interoperability-embedded-python/ai-coding/). |
| 65 | +For concrete workflows, use the [IoP cookbooks](https://grongierisc.github.io/interoperability-embedded-python/cookbooks/). |
| 66 | +For healthcare productions, also see [Healthcare AI-assisted coding](https://grongierisc.github.io/interoperability-embedded-python/healthcare-ai-coding/). |
57 | 67 |
|
58 | 68 | Happy coding! |
0 commit comments