Lack of pricing attribute

Hi,

I'm looking to extract a list of RICs' quotes using the refinitiv.dataplatform . I found this code online that worked for the user who created but I am unable to use it because it tells me the content refinitiv.dataplatform.content module does not have a pricing attribute. I am having similar issues with the search function. I am trying to understand if people are utilizing a different version and that's the cause of the different code. My current version is 1.0.0a20.

Code:

import refinitiv.dataplatform as rd

test_ric = ['465410AH1=2M', '718592AB4=2M', '059891AB7=2M', '059891AA9=2M', '448414AE2=2M']

response = rd.content.pricing.Definition(

test_ric,

fields=["BID_YIELD","ASK_YIELD", "BID", "ASK"]

).get_data()

response.data.df

error:

Traceback (most recent call last):

File "c:\Projects\test.py", line ##, in <module>

response = rd.content.pricing.Definition(

^^^^^^^^^^^^^^^^^^

AttributeError: module 'refinitiv.dataplatform.content' has no attribute 'pricing'

Best Answer

  • Hi @david.blanco

    Ensure you are importing the correct library:

    import refinitiv.data as rd
    test_ric = ['465410AH1=2M', '718592AB4=2M', '059891AB7=2M', '059891AA9=2M', 
    '448414AE2=2M']

    response = rd.content.pricing.Definition(
    test_ric,
    fields=["BID_YIELD","ASK_YIELD", "BID", "ASK"]
    ).get_data()

    ahs.png

Answers