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
899 stars 214 forks source link

get currency denomination for statements #34

Open windowpane opened 4 years ago

windowpane commented 4 years ago

Currently the get_financial_stmts() function has no way to let someone know what currency is being used for reporting. Yahoo finance sometimes reports financial statements in USD, CNY, RUB, and other currencies.

It would be a nice feature to also return what currency the income/cash/balance statements are reported in.

image

Relevant html snippet:

<span data-reactid="27">
<!-- react-text: 28 -->Currency in CNY. <!-- /react-text -->
<span data-reactid="29">All numbers in thousands</span>
</span>

It would be nice to include the denomination in the returned results.

e.g.,

{
'incomeStatementHistoryQuarterly': {
    'TICKER':  [ 
       {'2019-03-31': {
          'researchDevelopment': 30383000000,
          'effectOfAccountingCharges': None,
          'incomeBeforeTax': 1146941338000,
          'minorityInterest': 3299552533000,
            ....,
          'reportingCurrency': CNY }
       {'2018-12-31': {  ... } },
        ...
],
    'TICKER2': ...
 ...
}