Yfinance - alternatives?

Viewed 1249

I've started developing some stuff using yfinance but coming across a few issues. For one I can't get the financials, cashflow, earnings etc to work. The ticker.info function does have some of that data (say earnings) but far from everything.

Tried using .info function, but now getting the below error, which I'm not sure why I'm getting.

Is anyone using any other library to access fundamental and pricing data that they could recommend?

    self._institutional_holders = holders[1]

IndexError: list index out of range
1 Answers

It errors out because the particular stock you are looking at doesnt have any institutional_holders and it returns an empty table. I have modified "base.py" using the try & except and it works. It will return 'None', in case their are no institutional holders:

    try:
        self._institutional_holders = holders[1]
    except:
        self._institutional_holders = 'None'
        pass
Related