Built An HMO Calculator With StreamLit & Python

Kareem Rasheed babatunde
3 min readJul 4, 2021

--

The more you learn, the more you know. My journey into streamlit web development framework was to build a deeplearning app with it. I took a course on #Udemy and learnt the basic functions on streamlit and got to know different approach to build web apps using streamlit

The first approach is to download ANACONDA software from product/anaconda.com. Then open anaconda prompt to create a virtual environment to build your web app.

Secondly, you execute the command [conda create env -n “env-name”] to create the new environment. Afterwards, you will execute another command [conda activate ‘env-name’] to activate the new venv(virtual environment)

While you are happy to see your new environment updated on anaconda, you need to create a new DIRECTORY for your project. I prefer to create on desktop for easy access. Creating a directory is similar to ways you create folders on your system/computer.

I created a folder called ‘StreamlitAPP’ on my desktop then i went back to my anaconda prompt to change directory from current working directory. To change directory, you need to execute the following command;

[cd desktop]

[cd streamlitAPP]

When you are sure your present working directory, you can move to the next line of action. if you aint sure of your working directory, you can check the path on the prompt to be sure- (this look like -user/desktop/streamlitAPP)

Now we are almost ready to start our streamlit journey, first of all, install streamlit LIBRARY on your anaconda promt. Execute the command using ‘pip’;

[pip install streamlit]

After the streamlit is installed, you can now start building your project by creating a python file using any text editor like sublime or Atom. I used atom for my project. Please follow the following steps;

[Create a new folder in the streamlitAPP folder]

[Open this folder in Atom text editor]- NOTE: if you dont have atom, you can download from atom.io

[Open a new .py file from the folder]- like streamlit.py

[Start coding by importing streamlit you already installed]

While importing my streamlit installed. You would have to execute a command in your anaconda prompt to RUN the streamlit app;

[streamlit run streamlit.py]

This will create a localhost:#### and IP access for your work on the internet, you can always view your work on these two channels while you begin to code.

Take a look at my code snippet in my github repo for more understanding;

I was able to build my first streamlit app with the above code snippet, you can view in github repo.

Finally, the look of my app for viewers and readers:

My HMO Calculator built

Thanks for reading this content and would like to have your comment below, do let me know your contributions and support for this project.

Rasheed Kareem

--

--

Kareem Rasheed babatunde
Kareem Rasheed babatunde

Written by Kareem Rasheed babatunde

A data scientist with utmost goal of serving humanities and impacting knowledge

No responses yet