stockdaq.data.downloader.Downloader

class stockdaq.data.downloader.Downloader(api)

Bases: object

Base Downloader object. This shouldn’t be used directly.

Parameters

api (str) – The name of the API being used.

api

The name of the API being used.

Type

str

dataframe

The downloaded data.

Type

pandas.core.frame.DataFrame or None

export(self, criterion="date", prefix="", suffix="",

extension=”.h5”, conflict=”merge”, mergehow=”keep old”)

__init__(api)

Constructor

Parameters

api (str) – The name of the API being used.

Methods

__init__(api)

Constructor

export([criterion, prefix, suffix, …])

Export self.dataframe to hdf5 files, names derive from criterion.

export(criterion='date', prefix='', suffix='', extension='.h5', conflict='merge', mergehow='keep old')

Export self.dataframe to hdf5 files, names derive from criterion.

Parameters
  • criterion (str, optional) – Data in same file has same “date” or “year”. Defaults to date.

  • prefix (str, optional) – Prefix to the filename.

  • suffix (str, optional) – suffix to the filename, before the extension.

  • extension (str, optional) – Extension of the files. Defaults to “.h5”.

  • conflict (str, optional) – How to resolve conflicts. options are [“merge”, “overwrite”, “ignore”]. “merge”: append non-duplicating data to the existing datafile. “overwrite”: replace the existing file. “ignore”: don’t do anything.

  • mergehow (str, optional) – Only effective when conflict == “merge”. “keep old”: If there are duplicated indexes, keep old data. “update”: If there are duplicated indexes, keep new data.