Summary
I have written some python code that renders data in a way that makes sense in our organization. I have several recipes that I use over and over and would like them to fit cleanly into streamlit.
To grossly simplify:
import streamlit as st
def dump_data(region,title, df):
""" Display formatted information """
region.markdown(title)
region.dataframe(df)
def make_page():
# This gets called by making a container and passing it to my function
df = get_df()
c = st.container()
dump_data(c,title,df) # Call recipe here...not congruent with streamlit style
# I want my code to work the same as streamlit code where I just take the
# region.method to get data on the page
c = st.container()
c.dump_data(title,df)
# Or perhaps better
c = st.container()
c.my_package.dump_data(title,df)
What is the recommended way to add my method so it works like other streamlit ârenderablesâ for lack of a better term? I have dug a bit through the code and it isnât obvious how st
a module, is interchangeable with DeltaGenerator
and if there are constraints on just patching in new methods into the st package, or a DeltaGenerator.