def get_price_expr(tick,d): if isinstance(d,datetime.date): res = yfinance.get_historical(tick,d) print 'result: ',res return res else: return yfinance.get_price(tick)
def get_price(ticker,d): if d == 'realtime': return yfinance.get_price(ticker) print 'updating price' return yfinance.get_historical(ticker, d)