Developer: Syeda Abeeha Zehra
- ✅ Current weather by location (city, coordinates, postal code)
- ✅ 5-day weather forecast
- ✅ Clean weather data display
- ✅ Info endpoint with developer details
- ✅ CRUD operations with SQLite database
- ✅ Date range validation
- ✅ Location validation via geocoding
- ✅ Export data as JSON and CSV
- Install dependencies:
pip install -r requirements.txt-
Get a free API key from WeatherAPI.com:
- Sign up at: https://www.weatherapi.com/signup.aspx
- Copy your API key
-
Set environment variable:
# Windows PowerShell
$env:WEATHER_API_KEY="your_key_here"- Run the server:
uvicorn main:app --reload --port 8001- Visit: http://127.0.0.1:8001/docs
GET /weather?query=Toronto- Current weatherGET /forecast?query=Toronto- 5-day forecastGET /info- Developer informationPOST /records- Create weather recordGET /records- List all recordsPUT /records/{id}- Update recordDELETE /records/{id}- Delete recordGET /export?format=json- Export as JSONGET /export?format=csv- Export as CSV
- FastAPI
- SQLAlchemy
- SQLite
- WeatherAPI.com
- Nominatim (OpenStreetMap) for geocoding