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)
예제 #2
0
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)
예제 #3
0
 def testGetQuotes(self):
     googleFinance = GoogleFinance()
     data = googleFinance.getQuotes('NASDAQ:EBAY', '20110101', '20110110')
     assert len(data)
 def testGetQuotes(self):
     googleFinance = GoogleFinance()
     data = googleFinance.getQuotes('NASDAQ:EBAY', '20131101', None)
     print [str(q) for q in data]
 def testGetQuotes(self):
     googleFinance = GoogleFinance()
     data = googleFinance.getQuotes('NASDAQ:EBAY', '20131101', None)
     print[str(q) for q in data]
     assert len(data)
예제 #6
0
 def testGetQuotes(self):
     googleFinance = GoogleFinance()
     data = googleFinance.getQuotes('NASDAQ:EBAY', '20110101', '20110110')
     assert len(data)