forked from pythonhealthdatascience/stars-streamlit-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.py
More file actions
56 lines (42 loc) · 1.27 KB
/
Overview.py
File metadata and controls
56 lines (42 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import streamlit as st
from PIL import Image
import urllib
import urllib.request as request
st.set_page_config(
# page_title="Ex-stream-ly Cool App",
# page_icon="🧊",
layout="wide",
initial_sidebar_state="expanded",
menu_items={
# 'Get Help': 'https://www.extremelycoolapp.com/help',
# 'Report a bug': "https://www.extremelycoolapp.com/bug",
"About": "## Treatment centre sim. Adapted from Nelson (2013)."
},
)
INFO_1 = """**A simple simulation model of a urgent care and treatment centre.**"""
OVERVIEW_PATH = (
"https://raw.githubusercontent.com/pythonhealthdatascience/"
+ "stars-stlite-example/main/txt/overview.md"
)
def read_file_contents(path):
"""
Download the content of a file from the GitHub Repo and return as a utf-8 string
Notes:
-------
adapted from 'https://github.com/streamlit/demo-self-driving'
Parameters:
----------
path: str
e.g. file_name.md
Returns:
--------
utf-8 str
"""
response = request.urlopen(path)
return response.read().decode("utf-8")
st.title("Treatment Centre Simulation Model")
image = Image.open("img/nihr.png")
st.image(image)
st.markdown(INFO_1)
# plain english summary
st.markdown(read_file_contents(OVERVIEW_PATH))