Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticker.p_all_financial_data() only returns all the financials data of the last cycle #294

Open
felixswang opened this issue Oct 20, 2024 · 0 comments

Comments

@felixswang
Copy link

felixswang commented Oct 20, 2024

Describe the bug
Ticker.p_all_financial_data() only returns all the financials data of the last cycle

To Reproduce
My code:

from yahooquery import Ticker
import json

def json_serial(obj):
    if hasattr(obj, 'isoformat'):
        return obj.isoformat()
    raise TypeError(f"Type {type(obj)} not serializable")

symbol = 'AAPL'

stock = Ticker(symbol, username='user', password='password')

all_financial_data = stock.p_all_financial_data(frequency='q')

with open(f'{symbol}_all_financials.json', 'w', encoding='utf-8') as f:
    json.dump(all_financial_data.to_dict(), f, ensure_ascii=False, indent=4, default=json_serial)

print(f"All data has been saved to {symbol}_all_financials.json")

Expected behavior
In the doc, it should return all financials data of all the years

Screenshots

Desktop (please complete the following information):

  • OS: MacOS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant