stocksml.data

FetchData(symbols, apikey, start=None, stop=None, path=None, append=True)[source]

Download symbol data from iex using provided api key, counts against quota

Parameters
  • symbols (list of str) – list of ticker symbols to retrieve

  • apikey (str) – api token of the iex account to use

  • start (str) – start date of historical prices to retrieve. Format is yyyy-mm-dd. Default None uses current date

  • stop (str) – stop date of historical prices to retrieve. Format is yyyy-mm-dd. Default None uses current date

  • path (str) – path of folder to place downloaded data. Default None uses current directory

  • append (bool) – append new data to existing file or create if missing. Duplicate dates ignored. False will overwrite file. Default True

LoadData(symbols=None, path=None)[source]

Load price data from CSV files

Parameters
  • symbols (list of str) – list of ticker symbol files to load. Files should be in the form of symbol.csv. Default None loads all files in provided directory.

  • path (str) – path to symbol data files. Default None uses included demonstration data folder location

Returns

symbol dataframe

Return type

pandas.DataFrame

BuildData(sdf)[source]

Transform price data from symbol dataframe to training feature set

Parameters

sdf (pandas.DataFrame) – symbol dataframe

Returns

feature dataframe

Return type

pandas.DataFrame