Skip to content

turlapati/ip-weather-flow

Repository files navigation

IP Weather Forecast Prefect Workflow

This project implements a Prefect workflow that:

  1. Fetches the public IP address of the device using ipify.org
  2. Gets geo-location data for the IP address using ip-api.com
  3. Retrieves weather forecast data for the location using Open-Meteo API
  4. Displays the data in a dashboard with tables and trend graphs

Features

  • Runs every 15 minutes via Prefect scheduling
  • Caches API responses to respect rate limits
  • Creates Prefect artifacts for data visualization
  • Provides a Dash-based dashboard for viewing weather data

Files

  • ip_weather_flow.py - Main Prefect workflow implementation
  • weather_dashboard.py - Dash application for visualizing weather data
  • deploy_flow.py - Script to deploy the workflow with scheduling
  • requirements.txt - Project dependencies

Setup

  1. Install dependencies:

    pip install -r requirements.txt
    
  2. Start the Prefect server:

    prefect server start
    
  3. Deploy the flow:

    python deploy_flow.py
    
  4. Start the dashboard:

    python weather_dashboard.py
    
  5. Access the dashboard at http://localhost:8050

Notes

  • The workflow uses caching to avoid exceeding API rate limits
  • Weather data is displayed for the current day and the next few days
  • The dashboard automatically refreshes every minute

About

Prefect workflow example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published