Hi everybody.
I’m working on a small dashboard to show me my info from another app API.
I want to show all supported coin combination list & specific coin info.
To select specific coin it needs to be chosen from a list of coins via a selectbox().
As soon as I click or type a new coin combination from the selectbox() the page Refreshes or switches to a different state, idk…
can somebody help me to fix this problem?
All I need is for the app to show me the json file chosen from the coin list.
import streamlit as st
import pandas as pd
def supported_coins(client):
st.title('Supported Coins')
symbol = None
symb_list, ex_info = get_symbol_list(client)
st.subheader('There are {} supported coin combinations.'.format(len(symb_list)))
with st.beta_expander('Coin List', expanded=True):
st.write(symb_list)
with st.beta_expander('Coin data', expanded=True):
symbol = st.selectbox(label='Full Coin Discription', options=symb_list)
if symbol:
coin_page(symbol, ex_info)
def coin_page(symbol, info):
st.title(symbol)
for symb in info['symbols']:
if symb['symbol'] == symbol:
searh_result = symb
st.json(searh_result)
def get_symbol_list(client):
ex_info = client.get_exchange_info()
symb_list = [ ]
for symb in ex_info['symbols']:
symb_list.append(symb['symbol'])
return symb_list, ex_info