A guide for Building a Multi-Page Web Application Using Streamlit
A web-based application is a type of software that allows users to interact with the server through a web browser interface. The advantage of web-based apps is their portability meaning that users don't have to install any additional software.
As the level of complexity in an app grows, it becomes useful to organize them into multiple pages. The Multiple page web applications are easier to scale & are useful for getting analytical insights.
Streamlit is an open-source popular library that creates the front end in python itself & is well adapted by the Data Science community. Initially, it had no built-in multiple page capability, however, with the version 1.10.0 released in June-2022 we can create multiple pages natively in Streamlit without the need for external plug-ins.
In this post, I will guide you on how to build a Multi-Page Web application, share tips & tricks to get the most out of the Streamlit features & how to use the web app. If you want to straight away use the application see the video at the end of the article, ask me in the comment section & I will share the web app.
This application has been successfully used to Interpret the Pressure & Temperature Surveys of 4 wells of Offshore fields in India in a fun way as it gives more control to the User Engineer.
So, let’s start…
Building a Multi-Page Web application
Step1: We follow a special folder structure following Streamlit documentation which can be seen in the snippet below & it means that we will create a page folder & inside the folder we will keep python scripts of pages.

The repository which I have used for this Web application with the above folder structure is :

Tips: In the pages folder we use numbers as prefixes while naming them. This helps as pages are sorted in increasing order & this helps in the UI experience.

Step 2: In the repository, we will have one requirements.txt file & in this, I recommend you keep all dependencies of the Web application.

Tips: When we run the web application in Cloud, we will choose the Python environment which comes with python modules, we find that most of the errors are dependencies related. The main reason why an app fails to build properly is that the cloud is not able to find your dependencies. So keep even basic modules such as NumPy, Pandas & Matplotlib.
Step 3: We make the Hello.py script:

Step4: We will elements in pages python scripts

Step 5:Run the Streamlit app & We have built a Multi-Page Web App.
Congratulations! & Your home page of the app should look something like this:

Now you see the reason why this library is so well adapted by the Data Science community. It’s a very user-friendly & simple to use python library.
Before using the web application let me just explain why have I built it?
Most of the oil and gas producing wells are on artificial lifts. The Static (Shut-in) & dynamic(flowing) pressure & temperature surveys in the wells provides us
- PI(Productivity Index)
- Real fluid gradient
- Static Reservoir Pressure
- Optimizing the artificial lift.
If you want to read more about Pressure & Temperature surveys here is the link: Reservoir pressure and temperature — PetroWiki (spe.org).
I have built a Multi-Page Web Application for the Interpretation of Pressure & Temperature Surveys.
Using the Multi-Page Web App
Select Login from the Activity selection box on the home page.

I know it is asking for a password & for the free trial version, the password is 12345. So, hurry, use it & I’d love to hear feedbacks on how I can improve the user experience.
Upload the deviation data of the well

Upload the survey data:

After Uploading the application output looks like this:

The Interactive Interpretation window to assist the Engineer:

This Interpretation method is user-friendly & gives more flexibility to the Engineer. Our aim with this application is to Assist the Engineer & make the Interpretation process fast.
Here is the video if you want to straight away use the application:
I hope reading this post has guided you on how to make a Multi-Page Web App.
I encourage you to try out this Multi-Page Web Application for the Interpretation of pressure & temperature hole data. This app will automatically output the Interactive window with default parameters. The Engineer should tune the default parameters for better Interpretation & I hope the Engineer has fun while doing that.
The readers from Oil and Gas Industry should extract some real value from using this Web app & also Share them.
If you learned something new or enjoyed reading this article, please share it so that others can see it. Until then, see you in the next post!