RtGet() using lseg.data library

Hi, how would I do a function like =RtGet("SYD1", [@RIC], "COUPN_RATE") in python using the lseg.data library? Thanks
Answers
-
Thank you for reaching out to us.
Please check the answer on this discussion.
The LD example is on GitHub.
I am not sure what this SYD1 source is. Is it from your local RTDS server?
0 -
Hi thanks for this response.
For some reason now, this code works for my computer, but when I run it on someone else computer (who have the same reuters/refinitiv applications open), it just returns N/A values. Do you know why?
Thanks
—————————————————rd.open_session()
# Internal Server
stream = pricing.Definition(
universe=bonds_rics, # "INTERNAL_RIC"
fields=["YIELD", "GN_TXT24_1", "GN_TXT24_2"],
service="SYDDS1IR"
).get_stream()
stream.open()0 -
I am not sure what the SYDDS1IR is.
Typically, our real-time service name is IDN_RDF, or ELEKTRON_DD.
Therefore, this SYDDS1IR service could be your internal service. That machine may not see that service.
Can the Workspace app on that machine can access this SYDDS1IR service?
0 -
@Jirapongse
Thanks for the quick reply. SYDDS1IR is our internal server, and I am able to get our internal feeds when using the previous code provided. However, when the same code is run on other computers (with the same applications open in the background), it doesn't' work.
Any idea why?0 -
Are you using the desktop.workspace session or the platform.deployed session?
If you are using the desktop.workspace session, the Workspace application must be configured to see that service.
You may enable the debug log on both machines by using the following code to compare the behaviors.
config = rd.get_config()
config.set_param("logs.transports.file.enabled", True)
config.set_param("logs.transports.file.name", "lseg-data-lib.log")
config.set_param("logs.level", "debug")
rd.open_session()0 -
Thanks for this. Is there any way to just have the code work without debugging each computer? I.e. is there a way to open the session universally?
0 -
The session can't be opened universally.
The code needs to run on that machine to open a session.
0 -
Apologies - I meant, is there a way to structure the code such that I don't have to manually look through the config but rather just use the rd.open_session() etc functions?
0 -
If you mean opening sessions without any config file, please refer to this session example.
0 -
Hi @Jirapongse,
So, I've tried opening Refinitiv Workspace on a different computer first, and now the code works on that computer but not my other computer (i.e. the computer which opens Refinitiv Workspace first seems to work with the code, but then the other doesn't and just returns N/A values).
Any idea why this may be? Thanks0 -
This is what it says for the computer that just returns N/A values:
DesktopSession
name = 'workspace'connection = DesktopConnection
stream_auto_reconnection = True
handshake_url = http://localhost:9000/api/handshake
state = OpenState.Closed
session_id = 1
logger_name = sessions.desktop.workspace.1
0 -
And I think my Data API Proxy for this computer is http://localhost:9003/api/, , so do you know how I may fix my code to dynamically adjust for this?
0 -
The library connects to the API Proxy component which is a part of the LSEG Workspace to retrieve data.
Therefore, we need to make sure that the API Proxy is running properly on the machine.
You can refer to the Eikon Data API and Refinitiv Data Library - Troubleshooting article to make sure that the API Proxy is running properly.
0 -
Hi, sorry I'm still unsure as to why it only works on one computer and not others. Do you have an idea of what the issue may be?
0 -
First, you need to check if the API Proxy is running properly by referring to the Eikon Data API and Refinitiv Data Library - Troubleshooting article.
If the API Proxy is running properly, you need to enable the debug log with the following code to verify the problem in the library.
config = rd.get_config()
config.set_param("logs.transports.file.enabled", True)
config.set_param("logs.transports.file.name", "lseg-data-lib.log")
config.set_param("logs.level", "debug")
rd.open_session()With the code, the lseg-data-lib.log file will be created.
Please remove any private information from the log file and share it.
0 -
[2025-04-29T13:57:30.574955+10:00] - [session] - [DEBUG] - [7368 - Dummy-4] - [_session] - [__init__] - Creating session "sessions.desktop.workspace.0" based on session.desktop.Definition("desktop.workspace")
[2025-04-29T13:57:30.579955+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [_desktop_session] - [__init__] - DesktopSession created with following parameters: app_key="DEFAULT_WORKSPACE_APP_KEY", name="workspace" base_url="http://localhost:9000" platform_path_rdp="/api/rdp" platform_path_udf="/api/udf" handshake_url="/api/handshake"
[2025-04-29T13:57:30.589953+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [_session] - [_connection] - Created session connection SessionCxnType.DESKTOP
[2025-04-29T13:57:30.589953+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [_session_provider] - [session_provider] - + Session created: DesktopSession
name = 'workspace'
connection = DesktopConnection
stream_auto_reconnection = True
handshake_url = http://localhost:9000/api/handshake
state = OpenState.Closed
session_id = 0
logger_name = sessions.desktop.workspace.0
[2025-04-29T13:57:30.589953+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [_session] - [open] - Open session
[2025-04-29T13:57:30.738955+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [http_service] - [build_request] - HTTP Request id 0
url = http://localhost:9000/api/status
method = GET
headers = {'x-tr-applicationid': 'DEFAULT_WORKSPACE_APP_KEY'}
[2025-04-29T13:57:30.775955+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [http_service] - [request] - HTTP Response id 0
status_code = 200
text = {"statusCode":"ST_PROXY_READY","version":"3.9.2"}
[2025-04-29T13:57:30.775955+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [connection] - [debug] - Checking proxy url http://localhost:9000/api/status response : 200 - {"statusCode":"ST_PROXY_READY","version":"3.9.2"}
[2025-04-29T13:57:30.775955+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [connection] - [debug] - Port 9000 was retrieved from .portInUse file
[2025-04-29T13:57:30.775955+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [connection] - [debug] - Try to handshake on url http://localhost:9000/api/handshake...
[2025-04-29T13:57:30.775955+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [http_service] - [build_request] - HTTP Request id 1
url = http://localhost:9000/api/handshake
method = POST
headers = {'Content-Type': 'application/json', 'x-tr-applicationid': 'DEFAULT_WORKSPACE_APP_KEY'}
json = {'AppKey': 'DEFAULT_WORKSPACE_APP_KEY', 'AppScope': 'trapi', 'ApiVersion': '1', 'LibraryName': 'RDP Python Library', 'LibraryVersion': '1.6.2'}
[2025-04-29T13:57:30.780955+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [http_service] - [request] - HTTP Response id 1
status_code = 200
text = {"access_token":[REDACTED]:"bearer"}
[2025-04-29T13:57:30.780955+10:00] - [sessions.desktop.workspace.0] - [DEBUG] - [7368 - Dummy-4] - [_session] - [open] - Opened session
[2025-04-29T13:57:37.928398+10:00] - [sessions.desktop.workspace.0] - [INFO] - [7368 - Dummy-4] - [session] - [close_session] - Closing session
[2025-04-29T13:57:37.942420+10:00] - [sessions.desktop.workspace.0] - [INFO] - [7368 - Dummy-4] - [session] - [close_session] - Session is closed
[2025-04-29T13:57:39.325459+10:00] - [sessions.desktop.workspace.0] - [INFO] - [26180 - Dummy-7] - [session] - [close_session] - Closing session
[2025-04-29T13:57:39.328460+10:00] - [sessions.desktop.workspace.0] - [INFO] - [26180 - Dummy-7] - [session] - [close_session] - Session is closed
0 -
I didn't see any errors in the log.
0 -
Same, but for some reason the values extracted are just N/A
0 -
I didn't see any request messages in the log file.
Does the problem only happen with the SYDDS1IR service?
0 -
Yes that's correct. There's only an error with the SYDDS1IR service when I try to run the code on other computers (i.e. any computer that is not the first computer I open Refinitiv with)
0 -
-
Do you think it has something to do with my access token? Or will this automatically change if the session was open on a different computer?
0 -
With the desktop session, the library retrieves data through the Workspace application.
The code subscribes data from an internal service (SYDDS1IR). Therefore, I assume that the Workspace must be configured to the connect to a local ADS for a streaming service.
Moreover, the Feed names must be configured properly.
Instead of using the desktop session, LSEG Data Library for Python also supports the platform.deployed session which allows the library directly connects to a ADS server with a websocket connection. However, the ADS server must be configured to support websocket connections.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 689 Datastream
- 1.4K DSS
- 626 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 558 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 277 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 705 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 94 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛