yfinance-4.py
· 335 B · Python
Ham
import yfinance as yf
spy = yf.Ticker('SPY')
data = spy.funds_data
# show fund description
data.description
# show operational information
data.fund_overview
data.fund_operations
# show holdings related information
data.asset_classes
data.top_holdings
data.equity_holdings
data.bond_holdings
data.bond_ratings
data.sector_weightings
1 | import yfinance as yf |
2 | spy = yf.Ticker('SPY') |
3 | data = spy.funds_data |
4 | |
5 | # show fund description |
6 | data.description |
7 | |
8 | # show operational information |
9 | data.fund_overview |
10 | data.fund_operations |
11 | |
12 | # show holdings related information |
13 | data.asset_classes |
14 | data.top_holdings |
15 | data.equity_holdings |
16 | data.bond_holdings |
17 | data.bond_ratings |
18 | data.sector_weightings |