I have built a covid-19 dashboard using Streamlit python. Streamlit is an open source app framework for machine learning and data science used to build interactive and beautiful apps easily. This dashboard contains data visualization of covid of all the states of India. Data is visualized with the help of a bar chart, pie chart, and line graph.
Through this article we will cover the following topics :
Installing Streamlit
Building dashboard
Running streamlit app
Making requirements file
Sharing dashboard
Installing Streamlit :
Make sure you have python 3.6 – 3.8 already installed.
pip install streamlit.
import streamlit to check if it’s installed.
Building dashboard :
start with importing libraries which we will need.
Using imported library streamlit we can give title and introduction to our dashboard .In addition to this you can add image if u wish and background color .
st.title( ) for giving heading to the dashboard .
st.sidebar( ) for displaying data on the sidebar
st.image( ) for inserting image on the dashboard
st.markdown( ) to display text as markdown .
Loading the data
Data Caching
st.cache decorator indicates that Streamlit will perform internal magic so that the data will be downloaded only once and cached for the future. Streamlit keeps track of the function name, the code in the function body, and the input arguments we pass in the function call.
The main limitation of Streamlit’s data caching is that it cannot keep track of changes to the data happening outside of the function body.
Selector code :
Use a selection of options
Visualization Part
In the visualization part, we need to plot graphs based on the status of covid patients and the Number of cases of coronavirus in a particular state or selected state.
Get the dataset: If you wish to show the dataset you have used on the dashboard, this can also be done.
Running Streamlit App
Share your App
Put your app in a public GitHub repo along with the requirements.txt file.
To create requirements.txt use the following command on the anaconda command prompt.
pip install pipreqs
pipreqs .location
After doing the above commands you will get requirements.txt successfully saved in your required location.
Sign in to share.streamlit.io
Click on ‘Deploy an app’ and then paste your GitHub URL.
The media shown in this article are not owned by Analytics Vidhya and is used at the Author’s discretion.
A verification link has been sent to your email id
If you have not recieved the link please goto
Sign Up page again
Loading...
Please enter the OTP that is sent to your registered email id
Loading...
Please enter the OTP that is sent to your email id
Loading...
Please enter your registered email id
This email id is not registered with us. Please enter your registered email id.
Don't have an account yet?Register here
Loading...
Please enter the OTP that is sent your registered email id
Loading...
Please create the new password here
We use cookies on Analytics Vidhya websites to deliver our services, analyze web traffic, and improve your experience on the site. By using Analytics Vidhya, you agree to our Privacy Policy and Terms of Use.Accept
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.