This project uses a Cloud Function and Cloud Scheduler to fetch live weather data every 15 minutes and insert it into BigQuery.
- Google Cloud Functions (Python)
- Cloud Scheduler (cron-like scheduling)
- BigQuery (data storage)
- Open-Meteo API (weather source)
weather-pipeline/
├── main.py # Cloud Function to fetch and write data
├── requirements.txt # Python packages
├── deploy.sh # Deploys function + scheduler
├── cleanup.sh # Deletes all GCP resources
└── README.md
Cloud Schedulertriggers every 15 minutes.Cloud Functionfetches weather data via API.- Parses and writes data to
BigQuerytable. - You get historical weather snapshots.
-
Edit
deploy.shand replace:your-project-idyour_dataset
-
Run:
chmod +x deploy.sh
./deploy.sh| temperature | windspeed | recorded_at | fetched_at |
|---|---|---|---|
| 28.5 | 10.8 | 2024-06-21T10:00:00Z | 2024-06-21T10:00:10Z |
To delete all deployed resources:
chmod +x cleanup.sh
./cleanup.sh- Uses Open-Meteo API (no API key required)
- Timestamp columns use UTC
- Scheduler time zone is set to Asia/Kolkata
Happy building ☁️
