-
Notifications
You must be signed in to change notification settings - Fork 222
Open
Description
I have issue to get this information - it is not working at all anymore:
from yahoofinancials import YahooFinancials
yahoo_financials = YahooFinancials('AAPL')
print(yahoo_financials.get_financial_data())
Same problem with: get_stock_profile_data()
Is this a yahoo problem, or something in the package, which can be done. I run now a test before my script is running like:
def function_test(max_tests):
info = YahooFinancials('AAPL')
start_local = dt.datetime(2024, 1, 1).strftime('%Y-%m-%d')
end_local = datetime.today().strftime('%Y-%m-%d')
try:
response = info.get_net_income()
print(f'pos (1/{max_tests}): get_net_income ({response})')
except:
print('neg (1/{max_tests}): get_net_income')
try:
response = info.get_historical_price_data(start_date=start_local,
end_date=end_local,
time_interval='daily')
print(f'pos (2/{max_tests}): get_historical_price_data ({response})')
except:
print('neg (2/{max_tests}): get_historical_price_data')
try:
response = info.get_financial_stmts('annual', ['balance'])
print(f'pos (3/{max_tests}): get_financial_stmts BALANCE ({response})')
except:
print('neg (3/{max_tests}): get_financial_stmts BALANCE')
try:
response = info.get_financial_stmts('annual', ['income'])
print(f'pos (4/{max_tests}): get_financial_stmts INCOME ({response})')
except:
print('neg (4/{max_tests}): get_financial_stmts INCOME')
try:
response = info.get_financial_stmts('annual', ['cash'])
print(f'pos (5/{max_tests}): get_financial_stmts CASH ({response})')
except:
print('neg (5/{max_tests}): get_financial_stmts CASH')
try:
response = info.get_stock_profile_data()
print(f'pos (6/{max_tests}): get_stock_profile_data ({response})')
except:
print('neg (6/{max_tests}): get_stock_profile_data')
try:
response = info.get_stock_quote_type_data()
print(f'pos (7/{max_tests}): get_stock_quote_type_data ({response})')
except:
print('neg (7/{max_tests}): get_stock_quote_type_data')
try:
response = info.get_key_statistics_data()
print(f'pos (8/{max_tests}): get_key_statistics_data ({response})')
except:
print('neg (8/{max_tests}): get_key_statistics_data')
try:
response = info.get_earnings_per_share()
print(f'pos (9/{max_tests}): get_earnings_per_share ({response})')
except:
print('neg (9/{max_tests}): get_earnings_per_share')
try:
response = info.get_currency()
print(f'pos (10/{max_tests}): get_currency ({response})')
except:
print('neg (10/{max_tests}): get_currency')
try:
response = info.get_beta()
print(f'pos (11/{max_tests}): get_beta ({response})')
except:
print('neg (11/{max_tests}): get_beta')
try:
response = info.get_pe_ratio()
print(f'pos (12/{max_tests}): get_pe_ratio ({response})')
except:
print('neg (12/{max_tests}): get_pe_ratio')
try:
response = info.get_market_cap()
print(f'pos (13/{max_tests}): get_market_cap ({response})')
except:
print('neg (13/{max_tests})v: get_market_cap')
try:
response = info.get_financial_data()
print(f'pos (14/{max_tests}): get_financial_data ({response})')
except:
print('neg (14/{max_tests}): get_financial_data')
max_tests = 14
function_test(max_tests)
print (f'### test completed with 'AAPL' and {max_tests} functions')
kungfu-eric
Metadata
Metadata
Assignees
Labels
No labels