question

Upvotes
Accepted
3 0 1 4

Starting Workspace APP from python (Windows 11)

On the way to batch run my data collecting.

Plan is to schedule a .py script (
which of course contains
import refinitiv.data as rd
)

For the API to work, the desktop app needs to run, no other way I am told.

Hence, how can i start the app from a python script?

Saves me a Task Scheduler entry ... Task Scheduler being ... temperamental?

Here is a try that doesn't err our but doesn't start it either. Workspace needs to run as admin.

import os
import subprocess
app_path = r'C:\...AppData\Local\Refinitiv\Refinitiv Workspace'
command = f'runas /user:administrator "{app_path}"'
try:
os.system(command)
except Exception as e:
print(f"An error occurred: {e}")

workspaceworkspace-data-api#technologyapipython api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
81.1k 264 53 76

@the.swiss

Thank you for reaching out to us.

Typically, the desktop APIs are for desktop users who would like to retrieve data via APIs and the desktop users will manually start desktop applications.

To start it in Task Scheduler, please contact the Refinitiv Workspace support team directly via MyRefinitiv.

Otherwise, you may need to use the platform.rdp session instead.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
3 0 1 4

Thanks Jirapongse

I was never able to make platform.rdp work. Probably my bad.

Do i need a special license?

Since I had terrible (and still have some ) connection issues with RD, which look to me mostly authentication issues, maybe that would help, too.

Thanks for your quick answer, as always

Alfred

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@the.swiss

You may need to enable the debug log in the library by using the following code.

config = rd.get_config()
config.set_param("logs.transports.file.enabled", True)
config.set_param("logs.transports.file.name", "refinitiv-data-lib.log")
config.set_param("logs.level", "debug")
rd.open_session("platform.rdp")

Then, please share the log file and also remove your credentials (username and password) from the log file.

Yes, the platform session is for Data Platform - which is a separate product and would need its own credentials.
Upvotes
3 0 1 4

Thanks Gurpreet

For the avoidance of any doubt, with a workspace license, there is no way to access data through the API without having workspace app running.

If yes, then how do I start the app from a Python code line?

Cheers

Alfred

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi Alfred,

Yes, this is correct - Workspace and the data retrieved from it is licensed for single user who is signed into the Workspace. So, the app is required to be running before getting data using API.

Officially, we do not support any means of launching the Workspace app from the code. A user should launch it and sign-in into the Workspace.

If your application has a need for automatic retrieval using APIs then enterprise grade products like RDP or DSS would be a better fit for this purpose. Your LSEG account manager can help choose the right product based on content set.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.