Search code examples
pythonrquantmod

Does Python has a similar library like quantmod in R that can download financial statement data?


Does Python has a similar library like quantmod in R that can download financial statement data? I want to download the historical revenue of each stock in Python. Can someone give me a hint? Thanks.


Solution

  • Yes a lot of them, zipline, pandas and even matplotlib can download data from Yahoo Finance. I recommend you use pandas:

    >>> from pandas_datareader.data import DataReader
    >>> from datetime import datetime
    
    >>> goog = DataReader("GOOG",  "yahoo", datetime(2000,1,1), datetime(2012,1,1))
    >>> goog["Adj Close"]
    Date
    2004-08-19     49.982655
    2004-08-20     53.952770
    2004-08-23     54.495735
    2004-08-24     52.239197
    2004-08-25     52.802086
    ...