Hi, how would I do a function like =RtGet("SYD1", [@RIC], "COUPN_RATE") in python using the lseg.data library? Thanks
@Ricky_G
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?
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()
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?
@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?
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()
If you mean opening sessions without any config file, please refer to this session example.
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? Thanks
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
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?
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.
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?
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.
With the code, the lseg-data-lib.log file will be created.
Please remove any private information from the log file and share it.
[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'
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
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
I didn't see any errors in the log.
Same, but for some reason the values extracted are just N/A
I didn't see any request messages in the log file.
Does the problem only happen with the SYDDS1IR service?
You may need to contact the workspace support team via MyAccount to compare the configurations between the first computer and other computers.
You may check with the Quote app if the Workspace can see the SYDDS1IR service.
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?
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.