Code Organisation

Summary

I have currently making a mutli-page app which has the same graphs on each page but each graph although coded the same, takes in different dataframe columns. It feels like a waste to have the same code repeated, am I better making a graph Class in another file and importing the file into each streamlit page and just creating instances of the class? Will this still work when I want to host it online?

Yes, that is a good idea. There is nothing special about streamlit which would prevent you importing from another module or package.

2 Likes