Skip to content

Commit a8fd3dd

Browse files
committed
Update documentation to enhance clarity and structure, including examples and useful links
1 parent 1677862 commit a8fd3dd

File tree

5 files changed

+87
-18
lines changed

5 files changed

+87
-18
lines changed

docs/example.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Example
22

3-
Add an example of a business operation and messages in Python.
3+
This document provides an example of a business operation and messages in Python, along with instructions on how to register a component.
44

55
## Business Operation
66

7-
Here is an example of a business operation in Python:
7+
Below is an example of a business operation in Python:
88

99
```python
1010
from iop import BusinessOperation, Message
@@ -14,18 +14,18 @@ class MyBusinessOperation(BusinessOperation):
1414

1515
def on_init(self):
1616
# This method is called when the component is becoming active in the production
17-
self.log_info("[Python] ...MyBusinessOperation:on_init() is called")
17+
self.log_info("[Python] MyBusinessOperation:on_init() is called")
1818
return
1919

2020
def on_teardown(self):
2121
# This method is called when the component is becoming inactive in the production
22-
self.log_info("[Python] ...MyBusinessOperation:on_teardown() is called")
22+
self.log_info("[Python] MyBusinessOperation:on_teardown() is called")
2323
return
2424

2525
def on_message(self, message_input: 'MyRequest'):
2626
# Called from service/process/operation, message is of type MyRequest with property request_string
27-
self.log_info("[Python] ...MyBusinessOperation:on_message() is called with message:" + message_input.request_string)
28-
response = MyResponse("...MyBusinessOperation:on_message() echos")
27+
self.log_info("[Python] MyBusinessOperation:on_message() is called with message: " + message_input.request_string)
28+
response = MyResponse("MyBusinessOperation:on_message() echos")
2929
return response
3030

3131
@dataclass
@@ -37,13 +37,17 @@ class MyResponse(Message):
3737
my_string: str = None
3838
```
3939

40-
## Register a Component
40+
### Explanation
41+
42+
- **on_init**: This method is called when the component becomes active in the production.
43+
- **on_teardown**: This method is called when the component becomes inactive in the production.
44+
- **on_message**: This method is called from service/process/operation, and it processes the incoming message of type `MyRequest`.
4145

42-
To register a component, you need to create a setting.py file in the root of your project.
46+
## Register a Component
4347

44-
This file will be used to register your classes and productions.
48+
To register a component, create a `setting.py` file in the root of your project. This file will be used to register your classes and productions.
4549

46-
Example of setting.py:
50+
### Example of `setting.py`
4751

4852
```python
4953
import bo
@@ -53,8 +57,10 @@ CLASSES = {
5357
}
5458
```
5559

56-
Then you can use the iop command line to register your component:
60+
### Registering the Component
61+
62+
Use the `iop` command line to register your component:
5763

5864
```bash
5965
iop --migrate /path/to/your/project/setting.py
60-
```
66+
```

docs/getting-started/installation.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Before you begin, ensure you have the following installed:
88

99
- Python 3.6 or higher
1010
- IRIS 2021.1 or higher
11-
- Embedded Python configured in IRIS
12-
- [Configuring Embedded Python](TODO: Add link to the guide)
11+
- [Configuring Embedded Python](TODO: Add link to the guide)
1312

1413
## With PyPi
1514

docs/index.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
1-
IoP (Interoperability On Python)
1+
# IoP (Interoperability On Python)
22

33
[![PyPI - Status](https://img.shields.io/pypi/status/iris-pex-embedded-python)](https://pypi.org/project/iris-pex-embedded-python/)
44
[![PyPI](https://img.shields.io/pypi/v/iris-pex-embedded-python)](https://pypi.org/project/iris-pex-embedded-python/)
55
[![PyPI - Downloads](https://img.shields.io/pypi/dm/iris-pex-embedded-python)](https://pypi.org/project/iris-pex-embedded-python/)
66
[![PyPI - License](https://img.shields.io/pypi/l/iris-pex-embedded-python)](https://pypi.org/project/iris-pex-embedded-python/)
77
![GitHub last commit](https://img.shields.io/github/last-commit/grongierisc/interoperability-embedded-python)
88

9-
This proof of concept aims to show how the **iris interoperability framework** can be use with **embedded python**.
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+
11+
## Example
12+
13+
Here's a simple example of how a Business Operation can be implemented in Python:
14+
15+
```python
16+
from iop import BusinessOperation
17+
18+
class MyBo(BusinessOperation):
19+
def on_message(self, request):
20+
self.log_info("Hello World")
21+
```
22+
23+
## Installation
24+
25+
To start using this proof of concept, install it using pip:
26+
27+
```bash
28+
pip install iris-pex-embedded-python
29+
```
30+
31+
## Getting Started
32+
33+
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 Business Operation.
34+
35+
Happy coding!

docs/useful-links.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Useful Links
2+
3+
Explore the following resources to learn more about the project and see it in action:
4+
5+
### Training
6+
- [Training Repository](https://github.com/grongierisc/formation-template-python)
7+
A repository to learn how to use the project.
8+
9+
### Templates
10+
- [Project Template](https://github.com/grongierisc/iris-python-interoperability-template)
11+
A template to start a new project.
12+
13+
### Project Links
14+
- [PyPI](https://pypi.org/project/iris-pex-embedded-python/)
15+
The project on PyPI.
16+
- [GitHub](https://github.com/grongierisc/iris-python-interoperability-template)
17+
The project on GitHub.
18+
19+
### Demos
20+
- [Flask Demo](https://github.com/grongierisc/iris-flask-template)
21+
Demonstrates how to use the project with Flask.
22+
- [FastAPI Demo](https://github.com/grongierisc/iris-fastapi-template)
23+
Demonstrates how to use the project with FastAPI.
24+
- [Django Demo](https://github.com/grongierisc/iris-django-template)
25+
Demonstrates how to use the project with Django.
26+
- [Kafka Demo](https://github.com/grongierisc/iris-kafka-python)
27+
Example of using the project with Kafka.
28+
- [RAG Demo](https://github.com/grongierisc/iris-rag-demo)
29+
Example of using the project with RAG.
30+
- [IRIS Chemical](https://github.com/grongierisc/iris-chemicals-properties)
31+
Example of extracting chemical properties.
32+
- [Rest to DICOM](https://github.com/grongierisc/RestToDicom)
33+
Example of using the project with RestToDicom.
34+
- [OCR](https://github.com/grongierisc/iris-pero-ocr)
35+
Example of using the project with an OCR engine.

mkdocs.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ nav:
88
- Getting Started:
99
- Installation: getting-started/installation.md
1010
- First Steps: getting-started/first-steps.md
11-
- Example: example.md
12-
- Command Line: command-line.md
11+
- Reference:
12+
- Example: example.md
13+
- Useful Links: useful-links.md
14+
- API documentation:
15+
- Command Line Interface: command-line.md
1316

1417
theme: readthedocs

0 commit comments

Comments
 (0)