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

yf.Tickers to download info for multiple tickers and dynamically access each of them #86

Closed
liweidong1218 opened this issue Aug 1, 2019 · 1 comment

Comments

@liweidong1218
Copy link

Hi,

Thanks for creating such an useful tool!

I want to ask how would you dynamically access each objects if you have a list of tickers to download using yf.Tickers? Looks like I have to specify each ticker manually to access. For example, "tickers.AAPL.info".

Thank you!

@ranaroussi
Copy link
Owner

Hi,

The Tickers method was just a shortcut to create many Ticker objects... 😃

That being said, I've updated the latest version to include a download method, so:

import yfinance as yf

tickers = yf.Tickers("AAPL SPY")

data = tickers.download(...)
# ^^ returns dataframe

# individual ticker objects can be accessed via:
tickers.tickers.AAPL.info
tickers.tickers.AAPL.options
...

ranaroussi added a commit that referenced this issue Aug 2, 2019
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

2 participants