Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/f3riend/survey-counter-api
An API that counts and visualizes responses to surveys
https://github.com/f3riend/survey-counter-api
base64 data-science data-visualization flask-api json matplotlib python python3 rest-api seaborn
Last synced: about 24 hours ago
JSON representation
An API that counts and visualizes responses to surveys
- Host: GitHub
- URL: https://github.com/f3riend/survey-counter-api
- Owner: f3riend
- Created: 2024-06-19T18:48:29.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-19T20:04:30.000Z (5 months ago)
- Last Synced: 2024-11-11T05:38:34.151Z (9 days ago)
- Topics: base64, data-science, data-visualization, flask-api, json, matplotlib, python, python3, rest-api, seaborn
- Language: Python
- Homepage: http://friend.pythonanywhere.com/
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python Flask-API
## Story
Our school requested the development of a survey program: "We want you to develop a survey program for our school so that teachers and administrators can create surveys whenever they want. Only people in the specified category can participate in these surveys. Additionally, we want to view the survey results and download a survey as a PDF whenever we want." To fulfill this request, I developed an API using Python that visualizes the survey data.## Purpose
The primary purpose of this project is to count and visualize the answers to survey questions. The API processes survey data, creates visualizations, converts them to base64 format, and sends them back to the website for display.## Working Logic and Flowchart
The website sends a predetermined JSON structure to the API using JavaScript. The API processes the received data, generates visualizations, converts the visualizations to base64 format, and then returns them to the website.![flowchart](https://github.com/f3riend/flask-counter-api/blob/main/followchart.png)
## JSON Structure
Here is an example of the JSON structure expected by the API:Request Sample
```json
{
"questions": [
{
"question": "How do you rate our school?",
"answers": ["Excellent", "Good", "Average", "Poor"],
"response": ["Good", "Excellent", "Good", "Average", "Poor", "Good"]
},
{
"question": "Would you recommend our school to others?",
"answers": ["Yes", "No"],
"response": ["Yes", "Yes", "No", "Yes"]
}
]
}
```
Response Sample```json
{
"plots": [
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
]
}
```