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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
38 0 2 4

TR_Field params syntax

what's wrong with my assumed syntax here?

fields = ek.TR_Field('TR.BSPeriodEndDate(IncludePartial=No)', {'Period': 'FI-1'})

as after this, get_data throws an error.

Thank you

---> Please work on the documentation of your otherwise fantastic program.

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythondataparams
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.

1 Answer

Upvotes
Accepted
38 0 2 4

solved it.

You can enter parameters in 2 different ways.

either

fields = ek.TR_Field('TR.BSPeriodEndDate', {'Period': 'FI-1','IncludePartial': 'No'})

or

fields = ek.TR_Field('TR.BSPeriodEndDate(Period=FI-1,IncludePartial=No)')

BUT you cannot match the two...

QUESTION: Why was the syntax for the function created in such a way? Are there any params that require one way or the other? thank you

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 @vlscout,

The string based syntax allows you to copy & paste field names and parameters from Eikon Excel Formula Builder wizard or from Data Item Browser, which are currently the primary means for metadata discovery. Dictionary based syntax is arguably more native to Python. It's also arguably easier to read than flat string based syntax, especially for those who are used to ever so popular JSON.
Eventually we probably would like to standardize on one type of syntax. Which one do you prefer and why?

Thank you Alex! At this point, as a python newbie, I prefer the "everything in one string" syntax.

Click below to post an Idea Post Idea