def test_tables(): ibm = Stock("GM") assert ibm.chart_table().empty == False assert ibm.dividends_table().empty == False assert ibm.effective_spread_table().empty == False assert ibm.financials_table().empty == False assert ibm.volume_by_venue_table().empty == False
def get_financials(self, ref_symbol): """ Get financials from IEX @params: ref_symbol - Required : symbol (Str) """ stock = Stock(ref_symbol) financials = stock.financials_table(period="annual", token=IEX_TOKEN) #Add symbol name if not financials.empty: financials_len = len(financials.index) financials_arr = [ref_symbol] * financials_len financials.insert(loc=0, column='symbol', value=financials_arr) #Reorder dataframe financials = self.set_column_sequence(financials, ["symbol", "reportDate"]) return financials