Introduction
We are continuing with the use case discussion from Focusing on Significant Developments 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 Significant Development 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 Significant Developments 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 Significant Developments news stories per our companies of interest that are passed in as a parameter into verifyNewsAgainstSigDevReqs:
sigDevCheck is very straightforward we ascertain that provider includes Significant Developments code NS:SIGDEV:
and ricsInSubjectsCheck aims to match one of our RICs of interest:
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 Significant Development
- 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 Significant developments
- -l -optionally examine the new subscription
- -r - run it periodically to read all the messages on the queue and drain the queue
Subscription uses the filter that must include:
- Attribution NS:SIGDEV
- PermIDs for any companies that are required, we can include RICs as well
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:
Common Filtering Criteria
ES:1 = High Significance
ES:2 = Medium Significance
ES:3 = Low Significance
M:2E1 = Front Page
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/focusing-on-significant-developments-in-news-part-1