Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /
avatar image
Question by davidk · Feb 12, 2019 at 03:42 PM · pythoneikon data api

Type checking in Python

At several points in pyeikon 1.0.0 it appears the API is not using Python best practices for type checking. For example, in time_series.to_datetime:

if type(date_value) is timedelta:
   ...
if type(date_value) in (datetime, date):

These should really be:

if isinstance(date_value, timedelta):
   ...
if isinstance(date_value, (datetime, date)):

As is, for example, use of a pandas Timestamp as the start_date or end_date parameter fails, even though pandas.Timestamp is a subclass of datetime. This is especially frustrating as it means that the start_date parameter can't be set to, say, df.index[0] from a df that was itself returned by the get_timeseries API.

Similarly, get_data and get_timeseries currently require the rics parameter to be a list of strings. These should really take any iterable. If you need a list (for example to guarantee order), you should cast it internally. As-is you cannot, for example, pass a generator, a pandas Index, or numpy array to get_data or get_timeseries which is similarly frustrating (you cannot, for example, directly take the values of a query for index members and pass them into get_data without casting).

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

1 Reply

  • Sort: 
avatar image
REFINITIV
Answer by Zhenya Kovalyov · Feb 13, 2019 at 02:56 AM

@davidk that is a fair observation, thank you very much for the feedback. We will look into this.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
9 People are following this question.

Related Questions

From full bond description to a bond ISIN with Python

Getting CA.C fields via Eikon Data API

Issue getting credit ratings data with Python

API Proxy not available: 503 error code

Eikon Python API Empty Response for Private Company Financial Data - e.g. TR.Revenue, TR.GrossProfit

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges