最后活跃于 1730172603

修订 dfe9e7b5901c04dee7b6d5c8df90a5b820221140

yfinance-3.py 原始文件
1import yfinance as yf
2
3msft = yf.Ticker("MSFT")
4
5# get all stock info
6msft.info
7
8# get historical market data
9hist = msft.history(period="1mo")
10
11# show meta information about the history (requires history() to be called first)
12msft.history_metadata
13
14# show actions (dividends, splits, capital gains)
15msft.actions
16msft.dividends
17msft.splits
18msft.capital_gains # only for mutual funds & etfs
19
20# show share count
21msft.get_shares_full(start="2022-01-01", end=None)
22
23# show financials:
24msft.calendar
25msft.sec_filings
26# - income statement
27msft.income_stmt
28msft.quarterly_income_stmt
29# - balance sheet
30msft.balance_sheet
31msft.quarterly_balance_sheet
32# - cash flow statement
33msft.cashflow
34msft.quarterly_cashflow
35# see `Ticker.get_income_stmt()` for more options
36
37# show holders
38msft.major_holders
39msft.institutional_holders
40msft.mutualfund_holders
41msft.insider_transactions
42msft.insider_purchases
43msft.insider_roster_holders
44
45msft.sustainability
46
47# show recommendations
48msft.recommendations
49msft.recommendations_summary
50msft.upgrades_downgrades
51
52# show analysts data
53msft.analyst_price_targets
54msft.earnings_estimate
55msft.revenue_estimate
56msft.earnings_history
57msft.eps_trend
58msft.eps_revisions
59msft.growth_estimates
60
61# Show future and historic earnings dates, returns at most next 4 quarters and last 8 quarters by default.
62# Note: If more are needed use msft.get_earnings_dates(limit=XX) with increased limit argument.
63msft.earnings_dates
64
65# show ISIN code - *experimental*
66# ISIN = International Securities Identification Number
67msft.isin
68
69# show options expirations
70msft.options
71
72# show news
73msft.news
74
75# get option chain for specific expiration
76opt = msft.option_chain('YYYY-MM-DD')
77# data available via: opt.calls, opt.puts