def getYahoo( self, ticker, datacode ): """Return Yahoo data. Mapped to PyUNO through the Xsmf.rdb file""" try: x = float(yahoo.fetch_data(self, ticker, datacode)) except: x = yahoo.fetch_data(self, ticker, datacode) return x
def getYahoo(self, ticker, datacode): """Return Yahoo data. Mapped to PyUNO through the Xsmf.rdb file""" try: x = float(yahoo.fetch_data(self, ticker, datacode)) except: x = yahoo.fetch_data(self, ticker, datacode) return x
def getYahoo(self, ticker, datacode): # Retrieve the requested data try: s = yahoo.fetch_data(self, ticker, datacode) except Exception as ex: # x = yahoo.fetch_data(self, ticker, datacode) return str(ex) # If the data was retrieved, if possible, convert it to float try: x = float(s) except: x = s return x
def find_exchange(self, ticker): """Determine exchange ticker is traded on so we can query morningstar""" # query yahoo to determine which exchange our ticker is traded on exchange = yahoo.fetch_data(self, ticker, 54) if exchange == 'AMEX': exchange = 'XASE' return exchange elif exchange == 'NasdaqNM': exchange = 'XNAS' return exchange elif exchange == 'NYSE': exchange = 'XNYS' return exchange #catch errors else: return exchange
def getYahoo( self, ticker, datacode ): return yahoo.fetch_data(self, ticker, datacode)
def getYahoo(self, ticker, datacode): return yahoo.fetch_data(self, ticker, datacode)
def getYahoo(self, ticker, datacode): try: x = float(yahoo.fetch_data(self, ticker, datacode)) except: x = yahoo.fetch_data(self, ticker, datacode) return x