Build a Flask-powered web application that displays air quality data from the OpenAQ API v3. The dashboard will store data in a SQLite database and filter for potentially risky PM2.5 levels.
# Install dependencies
pip install flask flask-sqlalchemy requests py-openaq pytest
# Or use pipenv
pipenv install flask flask-sqlalchemy requests py-openaq pytest
- Visit OpenAQ API Key page
- Sign up for a free account
- Generate an API key
- Download
openaq.py
from the course materials - Place it in your project directory
- Use
starter.py
as your starting point - Follow the step-by-step instructions in the assignment
- Complete all TODO items
your-project/
├── aq_dashboard.py # Your completed solution
├── openaq.py # OpenAQ API wrapper (download from course)
├── test_aq_dashboard.py # Test file
├── requirements.txt # Dependencies
└── db.sqlite3 # SQLite database (created automatically)
# Run tests
python -m pytest test_aq_dashboard.py -v
# Expected output: 4 tests passing
# Python execution
Good luck! 🚀