项目作者: marcusschiesser

项目描述 :
Download and cache intraday finance market data using yfinance
高级语言: Python
项目地址: git://github.com/marcusschiesser/intraday.git
创建时间: 2020-01-12T03:22:23Z
项目社区:https://github.com/marcusschiesser/intraday

开源协议:MIT License

下载


intraday

Download and caches intraday finance market data and makes it available as pandas DataFrame.

Data is retrieved by using yfinance, a library
to download historical market data from Yahoo! finance.
Due to the limitations of yfinance, intraday data can only by downloaded for the last 30 days and only for 7 days per request.

Therefore this module is caching all retrieved data using CSV files. The goal of this project is to store as much
intraday data as possible, so please send pull requests with data updates.

Usage

  1. Save this module in the same directory as your Python file:

    1. $ git clone https://github.com/marcusschiesser/intraday.git
  2. Then you can call update_ticker to update and retrieve a Dataframe for a ticker symbol, e.g.: for SPY:

    1. import intraday
    2. df = intraday.update_ticker('SPY')
    3. df.head()

    This method gets the data from the cache (if it exists), appends 7 days of data from yfinance and updates the cache.

  3. To retrieve the Dataframe currently stored in the cache for a ticker symbol use get_ticker:

    1. df = intraday.get_ticker('SPY')

    This method converts the Datetime index to UTC.