Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 2

"How can I execute a DSGRID function using Python?"

"I have a list of ISINs for some corporate bonds in an Excel table and I want to get the time series data for these bonds, for the variable yield to redemption. I am currently using the DSGRID function in Excel, which looks like this: @DSGRID(Tabelle1!$A$1:$A$14;"RY";"-2Y";"";"D";"RowHeader=true;ColHeader=true;Transpose=true;DispSeriesDescription=false;YearlyTSFormat=false;QuarterlyTSFormat=false;AutoRefresh=false;MonthlyTSFormat=False";"")''' which gives the time series of the related ISINs of A1 to A14. Now, I would like to use Python in the following way: Specifically, I want Python to open the Excel table, execute the function, save the updated table, and then close it. However, I do not know how to pass this function to Excel using Python and to ensure that Excel then executes the function. I work with anaconda on windows.

python#technologydatastream
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.

1 Answer

· Write an Answer
Upvotes
Accepted
84.6k 287 53 77

@fiwi

Thank you for reaching out to us.

To use Python to control Excel applications, you need to use other third-party Python libraries (such as xlwings) which are not supported by LSEG.

However, we provide the Datastream WebService library (DatastreamPy) which can be used in Python. For more information, please refer to the Datastream WebService page on LSEG Developer Portal website.

Therefore, you can run a Python application that uses the DatastreamPy to retrieve historical data and then use the xlwings to populate data on Excel.

You can refer to the following articles that explain how to use xlwings.


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.

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.