Introduction
We are continuing with the use case discussion from Japanese Investor Briefs in News - Part 1 and next are going to look into:
- Using realtime streaming service with Refinitiv-Realtime Optimized in Python
- Using SQS queues in Python script
Refinitiv Realtime Optimized- How to Select Japanese Investor Briefs News
- Connect to Real-Time stremaing service
- If service is Refinitiv Real-Time Optmized, authenticate
- If service is Refinitiv Real-Time Optmized, we do Service Discovery
- Connect to the most available endpoint
- Subscribe to MRN news from Real-Time streaming service
- Assemble the complete stories per MRN model, including the metadata
- Use the metadata to select only Japanese Briefs news per our companies of interest
As Steps 1, 2 and 3 are described in detail in many excellent resources already we are going to omit the discussion here, please see References section and refer to the code example for the complete implementation. We are going to jump straight to step 4
We are going to use Metadata to select only Japanese Investor Briefs news stories per our companies of interest that are passed in as a parameter into verifyNewsAgainstJapaneseBriefsReqs:
singleCheck is very straightforward and we will use it to verify the required language:
multiCheck is very straightforward as well, and we will user it to verify that all required audiences and subjects are present:
the same approach can be easily extended to include more checks, if required. At present to test we can use the command line:
Refinitiv Data Platform with AWS Queues
- Subscription to headlines or stories with filtering on Japanese Briefs
- Preserve the last subscription information
- Retrieve the messages from SQS queue, print and remove iteratively until the queue is fully exhausted
Therefore, a typical testing sequence for this example runs can be enacted via command line parameters
- -d - delete all subscriptions
- -s - create new subscription for Japanese Briefs
- -l -optionally examine the new subscription
- -r - run it periodically to read all the messages on the queue and drain the queue
As an example we will use subscription filter that must include:
- product NP:RINBX
- language L:ja
- Newscode G:6J
So en example filter will look like:
we just preserve the last established subscription in a file
to be accessed by the next retrieve call, that will likely refer to the last subscription, without having to pass it in as a parameter. Alternatively endpointPerSubscription and cryptographyKey can be passed explicitely on teh commend line.
and in our retrieveAndRemove we just loop over:
We would like to round up this discussion by including a few relevant Feferences and inviting the reader to check out Refinitiv Developer Q&A Forums.
References
- Article code on GitHub: https://github.com/Refinitiv-API-Samples/Article.RDP.Python.FocusingOnSignificantDevelopmentsInNews
- MRN with Websockets Video: https://developers.refinitiv.com/en/video-catalog/how-to-consume-mrn-data-with-elektron-websocket-api
- Part 1 of this article: https://developers.refinitiv.com/en/article-catalog/article/japanese-investor-briefs-in-news-part-1