Using Python for Financial Data/Analyses

Ongoing Notes

Yahoo Finance one maintained an API.
However, this one is where it is at:
https://github.com/ranaroussi/yfinance

Basic use of yfinance:

from pandas_datareader import data as pdr
import yfinance as yf

The library is pretty deep. However, for most things, IMO, the “ticker” class is probably all you need.

aaplObj = yf.Ticker(“AAPL”)
aaplObj.dividends
# get dividends for 2018
aapl2018Dividend=sum(aaplObj.dividends.values[curTick.dividends.index.year==2018])

etc.