Package that loads a Streamlit interface

Is there a way that I can create a package that loads a Streamlit interface?
For example:

import app
app.foo()

Where app contains the code base for a streamlit application (I was hoping to make it as a callable package).

Hi @Shawn_D_Souza -

What’s the use case for doing this? Meaning, if the user already has Python installed (because they are using this package), why not have them run streamlit run file.py?

Best,
Randy

I designed a no-code application for EDA and ML.

I wanted to build a package that works similar to pandas profiling to_file(β€œoutput.html”)
So that when I call do_eda(data) it loads the output on the browser as a Streamlit interface.

I see. I suspect you could use a subprocess to call Streamlit, but that feels like it could cause some weird issues. Meaning, the Python process would be managing a separate Python process, and I’m not sure if there are issues around that with Streamlit.