# Put our database url
COVID_DATABASE_URL = 'https://www.covid19.act.gov.au/act-status-and-response/act-covid-19-exposure-locations'
from helpers import collect_data, check_shop, add_times, make_plot
current, archived = collect_data(url=COVID_DATABASE_URL)
data['Contact'] = data['Contact'].str.lower()
bools = [True, False]
Shops_to_check
See_archived
True
# Pick the dataframe we use
if See_archived:
data = archived
else:
data = current
shop_data = check_shop(data, Shops_to_check)
times = add_times(shop_data)
import os
if not os.path.exists('./.streamlit'):
os.mkdir('./.streamlit')
if not os.path.exists('./.streamlit/config.toml'):
with open('./.streamlit/config.toml','w') as f:
f.writelines(['[server]\n', 'port = 8080'])
!pip install streamlit
import streamlit as st
shops = st.text_input(label='Which shops do you want to analyse', value='Coles/Woolworths/IGA')
archived = st.checkbox(label='Include archived exposure sites?', value=True)
markdown_text = """
# Covid Exposure Sites Web App
---
## Usage:
Type in the stores that you want to see separated by slashes,
for example `Coles/Woolworths/IGA`, and select whether you want
to see the archived entries (`True`) or whether you want them to be hidden (`False`)
"""
st.markdown(markdown_text)
chart = make_plot(times, Shops_to_check)
st.write(chart)
st.write(shop_data)