class GoogleDAM(BaseDAM): ''' Google DAO ''' def __init__(self): ''' constructor ''' super(GoogleDAM, self).__init__() self.__gf = GoogleFinance() def readQuotes(self, start, end): ''' read quotes from google Financial''' if self.symbol is None: LOG.debug('Symbol is None') return [] return self.__gf.getQuotes(self.symbol, start, end) def readTicks(self, start, end): ''' read ticks from google Financial''' if self.symbol is None: LOG.debug('Symbol is None') return [] return self.__gf.getTicks(self.symbol, start, end) def readFundamental(self): ''' read fundamental ''' if self.symbol is None: LOG.debug('Symbol is None') return {} return self.__gf.getFinancials(self.symbol)
def testGetTicks(self): googleFinance = GoogleFinance() ret = googleFinance.getTicks('EBAY', start = '20110101', end = '20110110') print(ret)