def get_quotes( self, *args ): syms = qutils.extract_symbols( args ) self.logger.info("symbols read: %s" % ",".join( syms ) ) data = self._get_quotes_raw( syms ) tk = [ (d['e']+':'+d['t']).upper() for d in data] + \ [ d['t'].upper() for d in data ] res = {} for s in syms: sU = s.upper() if sU in tk: res[s] = data[ tk.index(sU) % len(data) ] return( res )
def get_quotes( self, *args ): syms = qutils.extract_symbols( args ) self.logger.info("symbols read : %s" % ",".join( syms ) ) data = self._get_select_raw( "yahoo.finance.quotes", syms ) tk = [ d['symbol'].upper() for d in data ] res = {} for s in syms: sU = s.upper() if sU in tk: res[s] = data[ tk.index(sU) ] return(res)