├── .idea
├── Streamlit.iml
├── misc.xml
├── modules.xml
├── vcs.xml
└── workspace.xml
├── Procfile
├── README.md
├── app.py
├── images
├── age.png
├── altair.png
├── bg.png
├── df.png
├── driving.png
├── explorer.png
├── explorer1.png
├── heroku_create.png
├── heroku_create_push.png
├── heroku_login.png
├── heroku_open.png
├── heroku_push.png
├── heroku_web.png
├── markdown.png
├── multiselect.png
├── slider.png
├── uber.jpg
└── uber.png
├── requirements.txt
└── setup.sh
/.idea/Streamlit.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
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 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 | 1573198503904
118 |
119 |
120 | 1573198503904
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | web: sh setup.sh && streamlit run app.py
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Deploying your Streamlit Application
2 | > A guide on creating and deploying your streamlit app to Heroku
--------------------------------------------------------------------------------
/app.py:
--------------------------------------------------------------------------------
1 | from vega_datasets import data
2 | import streamlit as st
3 | import altair as alt
4 |
5 | def main():
6 | df = load_data()
7 | page = st.sidebar.selectbox("Choose a page", ["Homepage", "Exploration"])
8 |
9 | if page == "Homepage":
10 | st.header("This is your data explorer.")
11 | st.write("Please select a page on the left.")
12 | st.write(df)
13 | elif page == "Exploration":
14 | st.title("Data Exploration")
15 | x_axis = st.selectbox("Choose a variable for the x-axis", df.columns, index=3)
16 | y_axis = st.selectbox("Choose a variable for the y-axis", df.columns, index=4)
17 | visualize_data(df, x_axis, y_axis)
18 |
19 | @st.cache
20 | def load_data():
21 | df = data.cars()
22 | return df
23 |
24 | def visualize_data(df, x_axis, y_axis):
25 | graph = alt.Chart(df).mark_circle(size=60).encode(
26 | x=x_axis,
27 | y=y_axis,
28 | color='Origin',
29 | tooltip=['Name', 'Origin', 'Horsepower', 'Miles_per_Gallon']
30 | ).interactive()
31 |
32 | st.write(graph)
33 |
34 | if __name__ == "__main__":
35 | main()
36 |
37 |
--------------------------------------------------------------------------------
/images/age.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/age.png
--------------------------------------------------------------------------------
/images/altair.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/altair.png
--------------------------------------------------------------------------------
/images/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/bg.png
--------------------------------------------------------------------------------
/images/df.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/df.png
--------------------------------------------------------------------------------
/images/driving.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/driving.png
--------------------------------------------------------------------------------
/images/explorer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/explorer.png
--------------------------------------------------------------------------------
/images/explorer1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/explorer1.png
--------------------------------------------------------------------------------
/images/heroku_create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/heroku_create.png
--------------------------------------------------------------------------------
/images/heroku_create_push.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/heroku_create_push.png
--------------------------------------------------------------------------------
/images/heroku_login.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/heroku_login.png
--------------------------------------------------------------------------------
/images/heroku_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/heroku_open.png
--------------------------------------------------------------------------------
/images/heroku_push.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/heroku_push.png
--------------------------------------------------------------------------------
/images/heroku_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/heroku_web.png
--------------------------------------------------------------------------------
/images/markdown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/markdown.png
--------------------------------------------------------------------------------
/images/multiselect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/multiselect.png
--------------------------------------------------------------------------------
/images/slider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/slider.png
--------------------------------------------------------------------------------
/images/uber.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/uber.jpg
--------------------------------------------------------------------------------
/images/uber.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MaartenGr/streamlit_guide/336c38aa72b3b4cc5f0aed98b561b6a37b3155c3/images/uber.png
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | streamlit==0.49.0
2 | vega-datasets==0.7.0
3 | altair==3.2.0
--------------------------------------------------------------------------------
/setup.sh:
--------------------------------------------------------------------------------
1 | mkdir -p ~/.streamlit/
2 |
3 | echo "\
4 | [general]\n\
5 | email = \"your-email@domain.com\"\n\
6 | " > ~/.streamlit/credentials.toml
7 |
8 | echo "\
9 | [server]\n\
10 | headless = true\n\
11 | enableCORS=false\n\
12 | port = $PORT\n\
13 | " > ~/.streamlit/config.toml
--------------------------------------------------------------------------------