JECSand / yahoofinancials

A powerful financial data module used for pulling data from Yahoo Finance. This module can pull fundamental and technical data for stocks, indexes, currencies, cryptos, ETFs, Mutual Funds, U.S. Treasuries, and commodity futures.
https://pypi.python.org/pypi/yahoofinancials
MIT License
896 stars 214 forks source link

TTM financial data instead of last quarter data #143

Open vvkorotkikh opened 1 year ago

vvkorotkikh commented 1 year ago

I try to get quarterly fundamentals.

ticker = 'BRK-B' yahoo_financials = YahooFinancials(ticker)#, concurrent=False, max_workers=1, country="US") data = yahoo_financials.get_financial_stmts('quarterly', 'income') data['incomeStatementHistoryQuarterly'][ticker][4]

The code above returns me data from last quarter {'2022-12-31': {'normalizedIncome': -22819000000.0, 'otherIncomeExpense': 53598000000.0, 'interestExpenseNonOperating': 1139000000.0, 'totalRevenue': 92628000000.0, 'sellingGeneralAndAdministration': 25056000000.0, 'dilutedNIAvailtoComStockholders': -22819000000.0, 'minorityInterests': -761000000.0, 'pretaxIncome': -30576000000.0, 'netIncomeCommonStockholders': -22819000000.0,

Some of values are scraped from 'TTM' column ('dilutedNIAvailtoComStockholders', 'sellingGeneralAndAdministration', 'minorityInterests' etc.) from source https://finance.yahoo.com/quote/BRK-B/financials?p=BRK-B and some values are scraped from '12/30/2022' column ('Total Revenue'). Pls fix. Безымянный

The same problem for 'BF-B', 'ACN' and some others.

cd109 commented 1 year ago

You can try to remove the data starting with trailingxxx in FUNDAMENTALS_MAP in maps.py

image

dubaleeiro commented 6 months ago

Same problem here. Would appreciate a fix on this... Thanks !!