Retrieve insights from Statista API and display Line-or-Pie chart via webpage
Download and Install Python (3.10 or above). Activate Virtual Environment and Install these libraries with peer dependencies:
python -m venv .venv
python -m pip install flask flask-cors requests matplotlib pandas python-dotenv
Create the following directory structure. Then, import and use individual components as required:
statista/
├── app.py
├── .venv
├── .env
├── .gitignore
├── requirements.txt
├── statista-project-structure
├── templates/
│ └── index.html
├── nppBackup/
│ └── app.py.2024-11-22_115328.bak
├── charts/ # Will store generated charts
│ └── charts.html #example
Run the Flask application (python app.py). Open the app in your browser (http://127.0.0.1:5000). Select a category, chart type, and optional premium content, then analyze or download the data. The updated frontend should integrate seamlessly with the enhanced app.py backend. Style as per your desire!
- Use Code to Flowchart to Visualize, Analyze, and Understand Your Code!