yfinance icon indicating copy to clipboard operation
yfinance copied to clipboard

yfinance 0.2.1: quarterly_balancesheet missing 'Total Stockholder Equity' attribute

Open galashour opened this issue 2 years ago • 14 comments

df_quarterly_balancesheet.loc['Total Stockholder Equity']

KeyError: 'Total Stockholder Equity'

galashour avatar Dec 20 '22 00:12 galashour

Does Yahoo actually have the data on website?

Also it's possible to access the old tables via get_cashflow(legacy=True) etc. We are open to suggestions to improve docs/API.

ValueRaider avatar Dec 20 '22 00:12 ValueRaider

yes - just verified on another setup that uses 0.1.93 in which the ticker_data.quarterly_balancesheet has different attributes than the one in 0.2.1 .

0.1.93 has: Index(['Intangible Assets', 'Total Liab', 'Total Stockholder Equity', 'Other Current Liab', 'Total Assets', 'Common Stock', 'Other Current Assets', 'Retained Earnings', 'Other Liab', 'Good Will', 'Gains Losses Not Affecting Retained Earnings', 'Other Assets', 'Cash', 'Total Current Liabilities', 'Short Long Term Debt', 'Other Stockholder Equity', 'Property Plant Equipment', 'Total Current Assets', 'Long Term Investments', 'Net Tangible Assets', 'Short Term Investments', 'Net Receivables', 'Long Term Debt', 'Inventory', 'Accounts Payable', 'Deferred Long Term Asset Charges'], dtype='object')

0.2.1 has: Index(['Total Assets', 'Current Assets', 'Cash Cash Equivalents And Short Term Investments', 'Cash And Cash Equivalents', 'Cash Financial', 'Cash Equivalents', 'Other Short Term Investments', 'Receivables', 'Accounts Receivable', 'Gross Accounts Receivable', 'Allowance For Doubtful Accounts Receivable', 'Inventory', 'Raw Materials', 'Work In Process', 'Finished Goods', 'Hedging Assets Current', 'Other Current Assets', 'Total Non Current Assets', 'Net PPE', 'Gross PPE', 'Properties', 'Land And Improvements', 'Buildings And Improvements', 'Machinery Furniture Equipment', 'Other Properties', 'Leases', 'Accumulated Depreciation', 'Goodwill And Other Intangible Assets', 'Goodwill', 'Other Intangible Assets', 'Investments And Advances', 'Long Term Equity Investment', 'Other Non Current Assets', 'Total Liabilities Net Minority Interest', 'Current Liabilities', 'Payables And Accrued Expenses', 'Payables', 'Accounts Payable', 'Total Tax Payable', 'Income Tax Payable', 'Pensionand Other Post Retirement Benefit Plans Current', 'Current Debt And Capital Lease Obligation', 'Current Debt', 'Current Deferred Liabilities', 'Current Deferred Revenue', 'Other Current Liabilities', 'Total Non Current Liabilities Net Minority Interest', 'Long Term Debt And Capital Lease Obligation', 'Long Term Debt', 'Long Term Capital Lease Obligation', 'Non Current Deferred Liabilities', 'Non Current Deferred Taxes Liabilities', 'Non Current Deferred Revenue', 'Tradeand Other Payables Non Current', 'Other Non Current Liabilities', 'Total Equity Gross Minority Interest', 'Stockholders Equity', 'Capital Stock', 'Common Stock', 'Retained Earnings', 'Gains Losses Not Affecting Retained Earnings', 'Total Capitalization', 'Common Stock Equity', 'Capital Lease Obligations', 'Net Tangible Assets', 'Working Capital', 'Invested Capital', 'Tangible Book Value', 'Total Debt', 'Net Debt', 'Share Issued', 'Ordinary Shares Number'], dtype='object')

galashour avatar Dec 20 '22 00:12 galashour

OK, I think figured it out, it moved from the 'quarterly_financials' to 'quarterly_balancesheet', and the attribute name was changed from 'Total Stockholder Equity' to 'Stockholders Equity'

galashour avatar Dec 20 '22 11:12 galashour

There are a few other attributes that have changed on the move to 0.2.1, such as: 'Cash' -> 'Cash And Cash Equivalents' 'Total Liab' -> 'Total Liabilities Net Minority Interest' 'Short Term Investments'-> 'Other Short Term Investments'

galashour avatar Dec 20 '22 11:12 galashour

Additional fields with slight attribute changes:

quarterly_cashflow.loc['Capital Expenditures'] ==> 'Capital Expenditure' quarterly_cashflow.loc['Total Cash From Operating Activities'] ==> 'Cash Flow From Continuing Operating Activities'

galashour avatar Jan 16 '23 16:01 galashour

Would this be better in a Wiki page? Anyone can edit that now.

ValueRaider avatar Jan 16 '23 16:01 ValueRaider

good idea. Can you open a topic with a link here, and I and possibly others can update there as we come across changes?

galashour avatar Jan 16 '23 16:01 galashour

Can I just link? I want Wiki to be a community-effort. https://github.com/ranaroussi/yfinance/wiki

ValueRaider avatar Jan 16 '23 16:01 ValueRaider

I added a page (seemed like the first page in the wiki). Pls double check it looks in the spirit you wanted. thnx.

galashour avatar Jan 16 '23 16:01 galashour

I just changed title. Content spirit is really for users to decide.

ValueRaider avatar Jan 16 '23 17:01 ValueRaider

updated the wiki with additional fields that were relocated in release 0.2.7

galashour avatar Jan 26 '23 23:01 galashour

The direct link to the wiki page is: https://github.com/ranaroussi/yfinance/wiki/Financial-tables---attribute-changes-in-yfinance-0.2

@ValueRaider With the motivation to reduce usage of Ticker.info, should we consider moving also the following attribute from Ticker.info to Ticker.fast_info (or will it make it 'too long')?:

'beta', 'longName', 'sector', 'industry', 'heldPercentInstitutions', 'heldPercentInsiders', 'dividendYield', 'exDividendDate', 'trailingPE', 'forwardPE', 'pegRatio', 'priceToBook', 'enterpriseToEbitda', 'profitMargins', 'SandP52WeekChange'

All of them are 'flat data' (one value attributes with no 'history values'), that seem to fit well with the data in fast_info, and may align well with the motivation to minimize the usage of (that is, if you don't think it will make fast_info too long).

currently users that do look for these fields need to make two queries, one for Ticker.info and one for Ticker.fast_info.

galashour avatar Jan 27 '23 08:01 galashour

The purpose of fast_info is to be fast, faster than fetching info. E.g. history() is much faster than info, so use that for price data. It's about alternative data sources, not length.

How can I make this clearer?

If you know of alternative faster data sources for your fields, then they can be added.

ValueRaider avatar Jan 27 '23 13:01 ValueRaider

@galashour I'm drafting an explanatory paragraph at top of README, does this clarify everything? #1366

ValueRaider avatar Jan 27 '23 15:01 ValueRaider

Can this be closed?

ValueRaider avatar Feb 06 '23 12:02 ValueRaider

yup. thnx

galashour avatar Feb 06 '23 13:02 galashour