question

Upvotes
1 0 0 0

Getting Datastream Code(DSCD) using LSEG Data Library

I'm working on an assginment that need index constituents' dscode for future references, by far I only found that we need to use datastream web service api to retrieve the dscodes of companies. I'm wondering if we can use the new LSEG data library in python to get it?

#productlseg-data-library
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
87k 294 53 79

@lixiong.he.2024

Thank you for reaching out to us.

LSEG Data Library can't connect to the Datastream WebService but it can convert RICs to DSCDs by using search.lookup. The example is on GitHub.

response = search.lookup.Definition(
    view=search.Views.SEARCH_ALL,                               # Required parameter
    scope="RIC",                                                       # Required parameter
    terms="MSFT.O,AAPL.O,GOOG.O,IBM.N,KBANK.BK,SCC.BK",                # Required parameter
    select="BusinessEntity,DocumentTitle,DsQuotationNumber",                 # Required parameter
).get_data()


response.data.df

The output is:

1728534341978.png



1728534341978.png (11.6 KiB)
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.

Thank you! I've also found out that LSEG data library cannot get some of the indices' constituents(eg. HEX25) but datastream seems to have the constituents list. I've looked up in eikon work space and the data items for such indices only have jointer or leaver constituents ric but not the regular constituents ric. Is there a way to bridge such gap?
Upvote
87k 294 53 79

@lixiong.he.2024

Please try the chain example to expand this chain RIC (0#.HEX25).

fchi = Chain("0#.HEX25")
fchi.constituents

1728615566909.png



1728615566909.png (8.7 KiB)
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.