This project built using Streamlit -- a web-based front-end for Python. In this project, you can display your public Google Forms's responds with many types of chart, and the best one is you can fully control which data you want to display in your Streamlit app.
- Google Forms: https://docs.google.com/forms/d/e/1FAIpQLSdz4jIkzSr6-adQfuZhkh86gHMyk72wUDWSVJiR_sRsZ_53BA/viewform
- Visualization: https://share.streamlit.io/tudemaha/forms-streamlit/main/forms-streamlit.py
Feel free to fill the anonymous form and visit the visualization website.
- Programming Language
- Python Libraries
- Streamlit [The main library]
- gsheetsdb [Used to connecting Google Sheets with Streamlit. (It's now replaced by shillelagh, but you still can use it.)]
- Matplotlib [For chart plotting]
- NumPy [Optional. In my case, just
fig3
used this library] - Pillow [Optional. I used this just for import the website's favicon]
- A little practice about
- Some Streamlit API [take a look on my source code for the APIs I used]
- Some Matplotlib Examples [In this project: pie, donut, and bar chart]
- Google's services
Create a Google Forms in a folder. There are two options to create the form:
- Create the form with only one word per question (e.g. city, age, etc.) and give a full questions in the description, or
- Create a normal form's questions (e.g. How old are you?, etc.)
In this project, I prefer to use the second one to make a pretty interface of the form and speed up form creation. This is my example form:
There are also two options to create the spreadsheets following the previous step:
- for the first option: only use the connected Google Forms's spreadsheet, or
- for the second option: use the connected Google Form's spreadsheet and make a new spreadsheet.
- Go to
Answer
(id=Jawaban) tab in the pre-built Google Forms - Click on the
Google Sheets
button to make a connected Spreadsheet
- Change your connected Google Sheet availability to public
- Go to your project folder in Drive
- Create a new blank Google Sheet (choose your own name)
- Make one word table header following on your connected Google Sheets header starting from cell
A1
(e.g. in your connected Google Sheets header is "How old are you?", just make "age" header for your new Google Sheets) - In cell
A2
, use=IMPORTRANGE()
formula to import the data from the connected Google Sheets- Import data from cell
A2
(A1
if you want to include the timeline) until your last data - Important: prepare your last data in formula and new spreadsheet up to 500 rows or more
- Import data from cell
- Change your new Google Sheet availability to public
To create the front-end of this app, take a little research in:
- Streamlit's official docs about Connect Streamlit to a public Google Sheet.
- "A little practice about" that I mentioned on Requirements section above.
- My source code
It's a simple way to deploy your app using Streamlit's free deployment service (https://share.streamlit.io). Just sign up using your email or connect your GitHub account to Streamlit and paste your GitHub repo link of your app.
Remember to put your
secrets
while deploying your app!
Read Streamlit's official docs about Deploy an app for more information.
Congratulation on your new Streamlit app 🎉