question

Upvotes
Accepted
16 0 1 4

rdp search returns nothing

Hi, I am using rdp.open_desktop_session in Python (IntelliJ Ultimate; rdp.version 1.0.0a7.post7) and running following :


baseString1 = "DerivedCategory eq 'BOND' and startswith( IssuerLegalName, 'CREDIT SUISSE' ) and OriginalIssueCurrency eq 'USD' and RIC ne null and ISIN ne null"

baseString2 = "DerivedCategory eq 'BOND' and startswith( CommonName, 'CREDIT SUISSE' ) and OriginalIssueCurrency eq 'USD' and RIC ne null and ISIN ne null"

srchfields = "RIC,ISIN, FullName, CommonName,CompanyName, SeniorityType,NativeIdentifier,DerivedCategory,OriginalIssueCurrency,ParentIndustrySector, CouponCurrency, CouponTypeDescription"

GroupSize = 5000

data1 = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=baseString1, top=GroupSize, select=srchfields)

data2 = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=baseString2, top=GroupSize, select=srchfields)

to get:


data1
data2
Out[13]: 
Empty DataFrame
Columns: []
Index: []

A) On top of that, I have a lot of Banks to loop over. What is the best strategy? Do I use the IssuerLegalName ?

B) Also, in Excel API, I could use the RIC or PermId of the Bank. What is the equivalent for PermId here? By the way, search using RIC does not seem to work.

basestringRIC = "DerivedCategory eq 'BOND' and RIC eq 'UBSG.S' and OriginalIssueCurrency eq 'USD' and ISIN ne null"

srchfields = "RIC,ISIN, FullName, CommonName,CompanyName, SeniorityType,NativeIdentifier,DerivedCategory,OriginalIssueCurrency,ParentIndustrySector, CouponCurrency, CouponTypeDescription"

GroupSize = 5000

dataUBS = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=basestringRIC, top=GroupSize, select=srchfields)

This returns:

dataUBS
Out[16]: 
Empty DataFrame
Columns: []
Index: []

Thanks

P.S.

this returns nothing in my case (It is being taken care of on a separate thread).

df = rdp.get_search_metadata(view = rdp.SearchViews.GovCorpInstruments)
rdp-apirefinitiv-data-platform
icon clock
10 |1500

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

On PermID I tried following:

srchfields = "RIC,ISIN, FullName, CommonName,CompanyName, SeniorityType,NativeIdentifier,DerivedCategory,OriginalIssueCurrency,ParentIndustrySector, CouponCurrency, CouponTypeDescription, IssuerLegalName"
GroupSize = 5000
basestringPermID = "DerivedCategory eq 'BOND' and  PermID eq  '4295890710' "

data_PermID = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=basestringPermID, top=GroupSize, select=srchfields)

#also tried:
basestringPermID  = "DerivedCategory eq 'BOND' and  PermID eq  '5000804106' "

Both basestringPermID returned nothing.

Upvotes
Accepted
9.7k 49 38 60

Hi @grigorios.mamalis,

I would highly recommend you use the:

response = rdp.Search.search()

syntax when building out your search expressions. The syntax you are using is a convenient, simple syntax that returns a dataframe. The libraries are layered to provide more granular details - the syntax above is the API call at the content layer of the library.

When I ran your first example 'baseString1', it failed because the startswith only accepts properties supporting exact match:

What you can do instead is perhaps use the organization ID (Perm ID) for Credit Suisse to return the list of bonds. Below is an updated filter that provides this. I also included a couple of other conditions around the status, i.e whether the bond is active and whether it has matured.

filterStr = "DerivedCategory eq 'BOND' and ParentOAPermID eq '4295890672' and \
             IsActive eq true and AssetStatus ne 'MAT' and \
             OriginalIssueCurrency eq 'USD' and RIC ne null and ISIN ne null"

Apply the above filter, I received a total of 5456 rows.


ahs.png (20.3 KiB)
icon clock
10 |1500

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

Upvotes
18k 21 12 20

Hi @grigorios.mamalis

I believe that your filter does not work as expected.

baseString1 = "DerivedCategory eq 'BOND' and startswith( IssuerLegalName, 'CREDIT SUISSE' ) and OriginalIssueCurrency eq 'USD' and RIC ne null and ISIN ne null"
baseString11 = "DerivedCategory eq 'BOND' and OriginalIssueCurrency eq 'USD' and RIC ne null and ISIN ne null"

baseString2 = "DerivedCategory eq 'BOND' and startswith( CommonName, 'CREDIT SUISSE' ) and OriginalIssueCurrency eq 'USD' and RIC ne null and ISIN ne null"
baseString22 = "DerivedCategory eq 'BOND' and OriginalIssueCurrency eq 'USD' and RIC ne null and ISIN ne null"

srchfields = "RIC,ISIN, FullName, CommonName,CompanyName, SeniorityType,NativeIdentifier,DerivedCategory,OriginalIssueCurrency,ParentIndustrySector, CouponCurrency, CouponTypeDescription"

GroupSize = 50

data1 = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=baseString1, top=GroupSize, select=srchfields)
data11 = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=baseString11, top=GroupSize, select=srchfields)

data2 = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=baseString2, top=GroupSize, select=srchfields)
data22 = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=baseString22, top=GroupSize, select=srchfields)

I added data11 and data22 which remove "and startswith( IssuerLegalName, 'CREDIT SUISSE' )" from your filter and it returned the result.

icon clock
10 |1500

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

Upvotes
18k 21 12 20

You can refer to this sample, https://github.com/Refinitiv-API-Samples/Example.RDPLibrary.Python.Search

Please see rdp.get_search_metadata(views)

You can use any fields which "Searchable" is true.


ahs.png (52.6 KiB)
icon clock
10 |1500

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

Upvotes
9.7k 49 38 60

Hi @grigorios.mamalis,

If you haven't had a chance, I would take a look at this Search Article. It will provide you with some helpful hints and tricks to figure out how to build out your search criteria.

icon clock
10 |1500

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

Upvotes
16 0 1 4

@chavalit.jintamalit Hi, well the point is that I wanted on purpose to retrieve data for given Bank and I wanted to repeat this procedure for a whole lot of Banks. Can you please reconsider your answer to take into account this?

Also, importantly I need to have a way to specify the names of the Banks in rdp space. I do have a list with names from EIKON GUI, but is there an attribute reflecting a Bank name that is valid across EIKON tools? (from GUI to dataplatform? I was thinking of IssuerLegalName or RIC or PermID but I need something that works for all cases. RIC and PermID do not seem to work in data platform e.g.)

Regarding rdp.get_search_metadata see P.S. section of my original e-mail where I say that this does not work for me in IntelliJ. In the meanwhile I found out that it works on CODEBK but I can only inspect it on that platform. Thanks

icon clock
10 |1500

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

Hi @grigorios.mamalis

Can you please reconsider your answer to take into account this?

Please review Nick's sample filter.(using PermID)


Regarding rdp.get_search_metadata - it works on CODEBK

I know that this is not perfect, you can use CODEBOOK to get metadata and export them to csv or excel file.

df = rdp.get_search_metadata(view = rdp.SearchViews.GovCorpInstruments) 
df.to_excel('gov-metadata.xlsx')

Then you can download the exported file and see the fields on your local machine.

ahs.jpg (376.3 KiB)
Upvotes
16 0 1 4

@ nick.zincone.1 · Many thanks for the hint regarding the PermID (that works nicely) and for the link with info.

icon clock
10 |1500

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

Upvotes
16 0 1 4

@nick.zincone.1

by the way why does the below does not work? I took the "A:C9" from the

navigators = "RCSCouponTypeGenealogy"
# does not work:
filterStr = " DerivedCategory eq 'BOND'  and IsActive eq true and AssetStatus ne 'MAT'  and endsWith(RCSCouponTypeGenealogy, 'A:C9' ) and  ParentOAPermID  eq  '4295890672'"

srchfields = "RIC,ISIN, FullName, InstrumentTypeDescription, RCSCouponTypeGenealogy"

data_PermID = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=filterStr, top=GroupSize, select=srchfields)

Thanks.

icon clock
10 |1500

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

Upvotes
9.7k 49 38 60

Hi @grigorios.mamalis,

The 'endsWith' should be 'endwith' (all lowercase).

Remember the advice above, don't use:

response = rdp.search() 

when building out your search algorithm. Instead use:

response = rdp.Search.search()

With the latter, you can interrogate the details, such as:

# status
response.status
# raw data (allows you to see navigator results
response.data.raw
# dataframe
response.data.df

Once you are happy with the outcome, then certainly use the

response = rdp.search()
icon clock
10 |1500

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

Upvote
16 0 1 4

Hi @nick.zincone.1 · , my bad. Many thanks for the correction regarding "endswith" as well as for the Search. Took note. All works fine.

icon clock
10 |1500

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

Click below to post an Idea Post Idea