A Python application that assesses paw burn risk for dogs based on weather conditions including temperature, UV index, and other environmental factors. The tool provides hourly risk scores, recommendations for protective footwear, and visualizations to help keep your furry friend safe.
## Features
- **Weather Data Integration**: Fetches historical, current, and forecast weather data from WeatherAPI.com
- **Smart Risk Scoring**: Calculates risk scores based on multiple factors:
- Air temperature (80°F, 90°F, 100°F+ thresholds)
- UV index (6, 8, 10+ thresholds)
- Weather conditions (sunny/clear conditions)
- Accumulated heat (rolling 2-hour average)
- Surface recovery time (cooling after peak temperatures)
- Rapid temperature swings detection
- **Intelligent Recommendations**: Provides actionable advice on when to use protective dog shoes
- **Data Persistence**: Stores weather and risk data in SQLite database
- **Rich Visualizations**: Creates comprehensive plots and dashboards
- **Configurable Parameters**: Customize thresholds and assessment criteria
- **Terminal Output**: Clean, formatted output for development and monitoring
## Installation
1.**Clone or download the project files**
2.**Install dependencies**:
```bash
pip install -r requirements.txt
```
3.**Set up environment variables**:
- Copy `env_template.txt` to `.env`
- Sign up for a free API key at [WeatherAPI.com](https://www.weatherapi.com/)
- Add your API key to the `.env` file:
```
WEATHER_API_KEY=your_actual_api_key_here
DEFAULT_LOCATION=Your City
```
4.**Test your setup**:
```bash
python test_setup.py
```
## 🚀 Quick Start
1.**Get your API key**: Sign up at [WeatherAPI.com](https://www.weatherapi.com/) (free)
2.**Set up environment**: `cp env_template.txt .env` and add your API key
The application includes an enhanced surface recovery model that accounts for cooling of surfaces after peak temperatures:
- **Basic Recovery**: Surfaces begin to cool after being exposed to high temperatures (above `SURFACE_RECOVERY_TEMP_THRESHOLD`). After `SURFACE_RECOVERY_HOURS`, a recovery credit reduces the risk score.
- **Graduated Recovery**: When enabled, provides a progressively stronger recovery benefit as more cooling time passes, up to `SURFACE_MAX_RECOVERY_SCORE`.
- **Surface Type**: Different surfaces cool at different rates:
- Asphalt: Slowest cooling (coefficient 0.7)
- Concrete: Moderate cooling (coefficient 0.85)
- Mixed: Standard cooling (coefficient 1.0)
- Grass: Fastest cooling (coefficient 1.5)
- **Time-of-Day**: When enabled, night hours (7pm-6am) provide 30% faster cooling than daylight hours.
- **Sun Exposure**: The algorithm considers sun exposure during the recovery period, which can slow cooling by up to 30%.
These factors combine to provide a more accurate assessment of surface temperatures throughout the day and the resulting paw burn risk.
The codebase is modular and extensible - feel free to enhance any component!
## Requirements
- Python 3.7+
- Internet connection for weather data
- WeatherAPI.com account (free tier available)
## License
This project is designed for pet safety and educational purposes. Please ensure you're following WeatherAPI.com's terms of service for API usage.
## Safety Note
This tool provides guidance based on environmental conditions, but always use your best judgment when it comes to your pet's safety. Factors like breed, age, paw pad condition, and individual sensitivity can vary significantly between dogs.