JerBouma / FinanceDatabase

This is a database of 300.000+ symbols containing Equities, ETFs, Funds, Indices, Currencies, Cryptocurrencies and Money Markets.
https://www.jeroenbouma.com/projects/financedatabase
MIT License
3.44k stars 387 forks source link

Some industry selectors fail #2

Closed Deekee62 closed 3 years ago

Deekee62 commented 3 years ago

Describe the bug The module seems to fail when the retrieved record length is too big!

It's working just fine when using:

fd.select_equities(country='United States', industry='Airlines') fd.select_equities(country='United States', industry='Railroads') fd.select_equities(country='United States', industry='Solar') fd.select_equities(country='United States', industry='Silver')

But it fails when the following is used:

fd.select_equities(country='United States', industry='Biotechnology')

To Reproduce Change industry in the example form "Airlines" to "Biotechnology"

Expected behavior N/A

Screenshots N/A

Desktop (please complete the following information):

Additional context Some differences I've detected are:

Airlines: 30 of 30 completed, 2 failed, 11 shown in graph Railroads: 27 of 27 completed, 0 failed, 12 shown in graph Solar: 49 of 49 completed, 1 failed, 31 shown in graph Silver: 9 of 9 completed, 1 failed, 3 shown in graph Biotechnology: 979 of 979 completed, 18 failed, NA

Errors reported in the console Traceback (most recent call last): Failed in quick_ratio = airlines_us_fundamentals[symbol]['financialData']['quickRatio'] KeyError: 'financialData'

JerBouma commented 3 years ago

Some tickers do not have any data as some products are simply holdings of companies. Use try/except statements in that case like I do in my Examples section.

You should checkout the ticker on Yahoo Finance and see what is available (and if it matters).