Search

Connectors

Contact support

Helpdesk portal

Interactive apps (Streamlit)

Build interactive apps with Streamlit in Peliqan, for example to search data, make updates to data, data entry, data quality checks etc.

Streamlit is a wonderful low-code Python module to add UI components with a single line of code per component. Streamlit is built-in into Peliqan and available as the st module.

Contents

  • Contents
  • UI elements
  • Show data
  • Input elements
  • Button
  • Dropdown (select)
  • Interactive grid with ability to update data
  • Upload file & show file (from base64)
  • Manage layout of a full-fledged app UI
  • Embedded Portal / Market place
  • Business application or widget
  • Layout tips & tricks

UI elements

Show data

Input elements

Button

button = st.button("Click me")
if button:
		# do stuff when button clicked

Dropdown (select)

option = st.selectbox("Please Choose", ["Email", "Home phone", "Mobile phone"])
st.write("You selected:", option)

Use a callback function to handle a selection:

def on_change():
    st.text(f"Selected option: %s" % st.session_state.my_selectbox)

st.selectbox("Please choose", ["A", "B", "C"], key = 'my_selectbox', on_change = on_change)

Save selection in Peliqan state and load from state on each run:

Interactive grid with ability to update data

Upload file & show file (from base64)

Manage layout of a full-fledged app UI

Embedded Portal / Market place

Use Streamlit to build a market place or portal, which can be embedded in your existing SaaS platform:

image
image
View example code of the above market place (portal) with tiles

Business application or widget

Use Streamlit to build a business application or widget:

image
View example code using a Streamlit grid and containers

Layout tips & tricks

Hide top header (with action menu and “Run” animation):

st.markdown(
    """
    <style>
        header {
            display: none !important;
        }
    </style>
    """,
    unsafe_allow_html=True
)

Make UI full width:

st.markdown(
    """
    <style>
        .block-container {
            width: 100% !important;
            padding: 20px !important;
            max-width: 100% !important;
        }
    </style>
    """,
    unsafe_allow_html=True
)