Converting a Jupyter Notebook to StreamLit application - Forte42/Realestate_of_Mind GitHub Wiki

To convert a Jupyter Notebook to a StreamLit application, you can do the following:

jupyter nbconvert --to script API_testing.ipynb streamlit run app.py

However, you may run into some issues.

NameError: name 'display' is not defined

It seems like Streamlit does not have the display function, so we will need to replace it with something like print. After replacing all the instances of display with print, you should be able to get past the error messages. However, the next issue that you will run up against is below.

Converting the Jupyter notebook only displays the first step

It appears that when you convert a Jupyter notebook to a Streamlit application, it will only display the first step.

Converting the Jupyter notebook to HTML

The next thing I tried is to convert the Jupyter notebook to an HTML file and run it on a web server. This almost works as we want it to.

However, you run into issues with interactivity for the plots with the county dropdowns.

References

How to publish a Jupyter notebook online — using AWS in 10 minutes!