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
Copy file name to clipboardExpand all lines: README.md
+60-41Lines changed: 60 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Please see the full documentation of this example application in [this article](
14
14
15
15
16
16
**Update (As of December 2021)**: The example now supports the Refinitiv Real-Time -- Optimized (RTO - formerly known as ERT in Cloud) connection.
17
-
* The RTO example is the mrn_console_rto.py console application file.
17
+
* The RTO console example: Please check my colleague's [Refinitiv-API-Samples/Example.WebSocketAPI.Python.MRN.RTO](https://github.com/Refinitiv-API-Samples/Example.WebSocketAPI.Python.MRN.RTO) GitHub Repository.
18
18
* The deployed Refinitiv Real-Time Distribution System (RTDS) examples are mrn_console_app.py console application and mrn_notebook_app.ipynb notebook files.
19
19
20
20
## Prerequisite
@@ -71,69 +71,88 @@ This example requires the following dependencies software and libraries.
71
71
72
72
## Application Files
73
73
This example project contains the following files and folders
74
-
1.*mrn_console_app.py*: The example application file
75
-
2.*notebook_python/mrn_notebook_app.ipynb*: The example Jupyter Notebook application file
74
+
1.*mrn_console_app.py*: The example console application for the deployed RTDS connection file
75
+
2.*notebook_python/mrn_notebook_app.ipynb*: The example Jupyter Notebook application for the deployed RTDS connection file
76
76
3.*Dockerfile*: The example application Dockerfile
77
77
3.*requirements.txt*: The application dependencies configuration file
78
78
4. LICENSE.md: Project's license file
79
79
5. README.md: Project's README file
80
80
81
-
## How to run this example
81
+
## <aid="how_to_run"></a>How to run this example
82
82
83
-
Please be informed that your Refinitiv Real-Time Advanced Data Hub and Refinitiv Real-Time Advanced Distribution Server should have a Service that contains MRN data. The first step is to unzip or download the example project folder into a directory of your choice, then choose how to run the application based on your environment below.
83
+
The first step is to unzip or download the example project folder into a directory of your choice, then choose how to run the application based on your environment below.
84
84
85
-
### A console example
86
-
1. Go to the project folder in the console
87
-
2. Run ```$> pip install -r requirements.txt``` command in a console to install all the dependencies libraries.
88
-
3. Then you can run mrn_console_app.py application with the following command
89
-
```
90
-
$> python mrn_console_app.py --hostname <Real-Time Advanced Distribution Server IP Address/Hostname> --port <WebSocket Port> --ric <MRN RIC name>
91
-
```
92
-
Optionally, the application subscribes ```MRN_STORY``` RIC code from Real-Time Advanced Distribution Server by default. You can pass your interested MRN RIC code to ```--ric``` parameter on the application command line. The supported MRN RIC codes are ```MRN_STORY```, ```MRN_TRNA```, ```MRN_TRNA_DOC``` and ```MRN_TRSI``` only. the application
85
+
### <aid="how_to_setup"></a>Set Up Environment
93
86
94
-
### Docker example
95
-
1. Go to the project folder in the console
96
-
2. Run ```$> docker build -t <project tag name> .``` command in a console to build an image from a Dockerfile.
97
-
```
98
-
$> docker build -t rtsdk_ws_mrn_python .
99
-
```
100
-
3. Once the build is a success, you can create and run the container with the following command
101
-
```
102
-
$> docker run --name mrn_console -it rtsdk_ws_mrn_python --hostname Real-Time Advanced Distribution Server IP Address/Hostname> --port <WebSocket Port> --ric <MRN RIC name>
103
-
```
104
-
4. If you want to connect the Docker container to a localhost, please use ```host.docker.internal``` as the Host name.
105
-
5. Press Ctrl+C buttons to stop the application
87
+
It is an advisable to create a dedicate Python environment to run each Python project. You can create a new Conda environment names *MRN_WEBSOCKET* with the following steps
106
88
107
-
### Classic Jupyter Notebook example
89
+
1. Open Anaconda Prompt and go to the project's folder
90
+
2. Run the following command in an Anaconda Prompt to create a Conda environment named *MRN_WEBSOCKET* for the project.
3. Once the environment is created, activate MRN_WEBSOCKET environment with this command in Anaconda Prompt
95
+
```
96
+
(base) $>conda activate MRN_WEBSOCKET
97
+
```
98
+
4. Run the following command to install the dependencies in the *MRN_WEBSOCKET* environment
99
+
```
100
+
(MRN_WEBSOCKET) $>pip install -r requirements.txt
101
+
```
102
+
### <aid="rtds_jupyter"></a>RTDS Jupyter Notebook example
108
103
109
-
Please be informed that Python [Anaconda](https://www.anaconda.com/distribution/) or [MiniConda](https://docs.conda.io/en/latest/miniconda.html) distribution/package manager is highly recommended for running the Jupyter Notebook example.
104
+
Please be informed that your Refinitiv Real-Time Advanced Data Hub and Refinitiv Real-Time Advanced Distribution Server should have a Service that contains MRN data. The Python [Anaconda](https://www.anaconda.com/distribution/) or [MiniConda](https://docs.conda.io/en/latest/miniconda.html) distribution/package manager is highly recommended for running the JupyterLab example.
110
105
111
106
1. Open Anaconda Prompt and go to the project's folder
112
-
2. Run the following command in an Anaconda Prompt to create a Conda environment named *mrn_python_notebook* for the project.
107
+
2. Activate MRN_WEBSOCKET environment with this command in Anaconda Prompt
4. In the current Anaconda Prompt, go to the project's notebook folder. Run the following command to start the JupyterLab application in the notebook folder.
119
116
```
120
-
4. In mrn_python_notebook environment, install the following prerequisite libraries
Please be informed that your Refinitiv Real-Time Advanced Data Hub and Refinitiv Real-Time Advanced Distribution Server should have a Service that contains MRN data.
124
+
125
+
1. Open Anaconda Prompt and go to the project's folder
126
+
2. Activate MRN_WEBSOCKET environment with this command in Anaconda Prompt
127
+
```
128
+
(base) $>conda activate MRN_WEBSOCKET
127
129
```
128
-
5. Go to the project's notebook folder in the console
129
-
6. Run the following command in a console to start the classic Jupyter Notebook in the notebook folder.
130
+
3. Then you can run mrn_console_app.py application with the following command
130
131
```
131
-
(mrn_python_notebook) $>jupyter notebook
132
+
(MRN_WEBSOCKET) $> python mrn_console_app.py --hostname <Real-Time Advanced Distribution Server IP Address/Hostname> --port <WebSocket Port>
132
133
```
133
-
7. Open *mrn_notebook_app.ipynb* Notebook document, then follow through each notebook cell.
134
+
4. The application subscribes to ```MRN_STORNY``` RIC code from Real-Time Advanced Distribution Server by default. You can pass your interested MRN RIC code to ```--ric``` parameter on the application command line. The supported MRN RIC codes are ```MRN_STORY```, ```MRN_TRNA```, ```MRN_TRNA_DOC``` and ```MRN_TRSI``` only.
135
+
136
+
### <aid="rto_console"></a>RTO console example
137
+
138
+
Please check my colleague's [Refinitiv-API-Samples/Example.WebSocketAPI.Python.MRN.RTO](https://github.com/Refinitiv-API-Samples/Example.WebSocketAPI.Python.MRN.RTO) GitHub Repository.
139
+
140
+
Alternatively, the *mrn_trna_console_rto.py* example of the [Refinitiv-API-Samples/Example.WebSocketAPI.Python.TRNA](https://github.com/Refinitiv-API-Samples/Example.WebSocketAPI.Python.TRNA) also supports the MRN consumer with RTO, but it subscribes to ```MRN_TRNA``` RIC code from the RTO by default.
141
+
142
+
143
+
### Docker example
144
+
1. Go to the project folder in the console
145
+
2. Run ```$> docker build -t <project tag name> .``` command in a console to build an image from a Dockerfile.
146
+
```
147
+
$> docker build -t rtsdk_ws_mrn_python .
148
+
```
149
+
3. Once the build is a success, you can create and run the container with the following command
150
+
```
151
+
$> docker run --name mrn_console -it rtsdk_ws_mrn_python --hostname Real-Time Advanced Distribution Server IP Address/Hostname> --port <WebSocket Port> --ric <MRN RIC name>
152
+
```
153
+
4. If you want to connect the Docker container to a localhost, please use ```host.docker.internal``` as the Host name.
154
+
5. Press Ctrl+C buttons to stop the application
134
155
135
-
*Note:*
136
-
- You can install a classic Jupyter Notebook on your local machine and then test the example on the machine. The alternate choice is a free Jupyter Notebook on cloud environments such as [Azure Notebook](https://notebooks.azure.com/) provided by Microsoft. You can find more details from [this tutorial](https://docs.microsoft.com/en-us/azure/notebooks/tutorial-create-run-jupyter-notebook). If you are not familiar with Jupyter Notebook, the following [tutorial](https://www.datacamp.com/community/tutorials/tutorial-jupyter-notebook) created by DataCamp may help.
137
156
138
157
## Example Results
139
158
### Send MRN_STORY request to Real-Time Advanced Distribution Server
0 commit comments