Weatherbot
A local hurricane alert system with NHC cone tracking, NWS alerts, and AI-powered threat analysis.
⚠️ IMPORTANT DISCLAIMER
THIS SOFTWARE IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY AND SHOULD NOT BE USED AS THE SOLE SOURCE FOR LIFE-SAFETY DECISIONS.
- NOT AN OFFICIAL SOURCE: Weatherbot is not affiliated with or endorsed by NOAA, NHC, NWS, or any official weather service
- NO WARRANTY: This software is provided "AS IS" without warranty of any kind, express or implied
- AI LIMITATIONS: AI-powered analysis may produce incorrect assessments and should never replace official meteorological guidance
- USER RESPONSIBILITY: Users must independently verify all weather information through official sources
- EMERGENCY GUIDANCE: Always follow official evacuation orders and emergency guidance from local authorities
- NO LIABILITY: The authors and contributors assume no responsibility for decisions made based on this software
For official weather information and emergency guidance, always consult:
- National Hurricane Center (nhc.noaa.gov)
- National Weather Service (weather.gov)
- Local emergency management authorities
- Official evacuation orders and emergency broadcasts
📋 FULL LEGAL DISCLAIMER: See DISCLAIMER.md for complete liability terms and conditions.
Overview
Weatherbot is a comprehensive hurricane monitoring and alerting system designed to provide real-time notifications for tropical weather threats. It combines data from the National Hurricane Center (NHC) forecast cones, National Weather Service (NWS) alerts, and optional AI-powered analysis of official NOAA weather maps to deliver precise, location-specific threat assessments.
Key Features
- Real-time Hurricane Tracking: Monitors active NHC forecast cones and determines if your location is at risk
- NWS Alert Integration: Receives and processes official hurricane watches and warnings
- AI-Enhanced Analysis: Optional OpenAI integration for intelligent threat assessment using official NOAA maps
- Multi-level Alert System: 5-tier alert system from "All Clear" to "Hurricane Warning"
- Multiple Notification Methods: Toast notifications
- Geometric Precision: Point-in-polygon and county-level intersection analysis
- Comprehensive Reporting: Generates detailed HTML reports with storm tracking maps
- Flexible Configuration: Supports both point-based and county-based threat detection
Installation
Prerequisites
- Python 3.11 or higher
- Windows 10/11 (for toast notifications)
Setup
-
Clone the repository:
git clone https://github.com/nathanramoscfa/weatherbot.git cd weatherbot
-
Create and activate a virtual environment:
# Windows python -m venv venv venv\Scripts\activate # Linux/macOS python -m venv venv source venv/bin/activate
-
Install the package:
pip install -e .
-
Install development dependencies (optional):
pip install -e .[dev]
-
Configure environment variables: Copy
env.exampleto.envand configure your settings:copy env.example .env
Edit
.envwith your location and preferences:# Required: Your home coordinates HOME_LAT=25.7617 HOME_LON=-80.1918 # Optional: OpenAI API key for AI analysis OPENAI_API_KEY=your_api_key_here # Optional: County-based intersection (requires GeoJSON file) USE_COUNTY_INTERSECT=false COUNTY_GEOJSON_PATH=src/weatherbot/data/default_area.geojson # Alert settings ALERT_COOLDOWN_MINUTES=60 TOAST_ENABLED=true
How to Run
Basic Monitoring
Run the main monitoring cycle:
weatherbot run
Run once and exit (useful for scheduled tasks):
weatherbot run --once
Run with verbose logging:
weatherbot run --verbose
AI-Powered Analysis
Get AI analysis of current hurricane threats:
weatherbot ai-analysis
🌍 Global Coverage: For locations outside NOAA coverage areas, weatherbot automatically uses AI web search to find weather alerts and warnings from local meteorological services, providing worldwide weather threat analysis.
Testing Notifications
Test your notification systems:
weatherbot test-alert
Check Coverage
Validate if your coordinates are within NOAA coverage areas:
weatherbot check-coverage
View Official Maps
Open the official NOAA hurricane map:
weatherbot show-map
State Management
View current state:
weatherbot state show
Clear state file:
weatherbot state clear
Debug Commands
View NHC MapServer layers:
weatherbot debug layers
Show detailed storm data:
weatherbot debug storm-data
Test AI storm detection:
weatherbot debug test-ai
Clear API cache:
weatherbot debug clear-cache
How to Test
Running Tests
Run all tests:
pytest
Run tests with verbose output:
pytest -v
Run specific test files:
pytest tests/test_smoke.py
pytest tests/test_geometry.py
Run tests with coverage:
pytest --cov=weatherbot
Test Categories
- Smoke Tests (
test_smoke.py): Basic import and configuration tests - Geometry Tests (
test_geometry.py): Coordinate validation and geometric operations - Integration Tests: End-to-end functionality testing
Development Setup
-
Install pre-commit hooks:
pre-commit install -
Run code formatting:
black src/ tests/
-
Run linting:
ruff check src/ tests/
-
Run type checking:
mypy src/weatherbot -
Run security scans:
make security
Configuration
Required Settings
HOME_LAT: Your latitude (decimal degrees)HOME_LON: Your longitude (decimal degrees, negative for Western Hemisphere)
⚠️ Important:
- NOAA Coverage: Atlantic Basin (0-60°N, 100°W-0°E), Eastern Pacific Basin (0-60°N, 180°W-100°W), Central Pacific Basin (0-60°N, 180°W-140°W)
- Global Coverage: Locations outside NOAA coverage automatically use AI web search fallback
- Recommended: US East Coast, Caribbean, Gulf of Mexico for most accurate results
Use weatherbot check-coverage to validate your coordinates before running the system.
Optional Settings
OPENAI_API_KEY: Enable AI-powered threat analysisUSE_COUNTY_INTERSECT: Use county polygon instead of point-based detectionCOUNTY_GEOJSON_PATH: Path to county boundary GeoJSON fileALERT_COOLDOWN_MINUTES: Minimum time between alerts (default: 60)LOG_LEVEL: Logging level (DEBUG, INFO, WARNING, ERROR)
Notification Settings
TOAST_ENABLED: Enable Windows toast notifications
Alert Levels
- Level 1 - All Clear: No threats detected
- Level 2 - Tropical Storm Threat: Tropical storm conditions possible
- Level 3 - Hurricane Threat: Hurricane conditions possible, tropical storm watch/warning may be in effect
- Level 4 - Evacuation Zone: Hurricane watch in effect, evacuation may be recommended
- Level 5 - Hurricane Warning: Hurricane warning in effect, immediate action required
Architecture
Core Components
- CLI Interface (
cli.py): Typer-based command-line interface - Configuration (
config.py): Pydantic-based settings management - NHC Integration (
nhc.py,nhc_storm_tracker.py): Hurricane cone data retrieval - NWS Integration (
nws.py): Weather alert processing - AI Analysis (
ai_map_analyzer.py,ai_enhancer.py): OpenAI-powered threat assessment - Geometry Engine (
geometry.py): Spatial analysis and intersection detection - Alert System (
alerting.py,alert_levels.py): Multi-tier notification system - State Management (
state.py): Persistent state tracking - Reporting (
reports.py): HTML report generation
Data Sources
- NHC MapServer: Real-time hurricane forecast cones
- NWS API: Official weather alerts and warnings
- NOAA Maps: Official tropical weather outlook imagery
- CurrentStorms.json: Active storm position data
License and Liability
MIT License - see LICENSE file for details.
Additional Liability Disclaimer
WEATHERBOT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. The MIT License includes important liability limitations, but we want to emphasize:
- NO WARRANTIES: No express or implied warranties regarding accuracy, reliability, or fitness for any particular purpose
- NO LIABILITY: Authors and contributors shall not be liable for any damages arising from use of this software
- WEATHER RISKS: Weather prediction and alerting involves inherent uncertainties and risks
- USER ASSUMES RISK: Users assume all risks associated with relying on this software for weather-related decisions
CRITICAL: This software may produce false positives, false negatives, or incorrect threat assessments. Never rely solely on Weatherbot for life-safety decisions.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
Support
For issues and questions, please use the GitHub issue tracker.
Metadata
Release files for weatherbot 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| weatherbot-1.0.0.tar.gz | 125.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| weatherbot-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 219.5 kB
Release files / weatherbot-1.0.0.tar.gz
| Download URL | weatherbot-1.0.0.tar.gz |
|---|---|
| Size | 125.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7ca5033ea604a3d4b531e9c84a6c4533b4d3b546a8557b05bde81610e9efbee
|
|
BLAKE2b-256 checksum How to use checksums |
bb9d8a374e4cd1e0bc00cc3515c2daa73b60bf2cb9187fac80c9aeafa0e667be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / weatherbot-1.0.0-py3-none-any.whl
| Download URL | weatherbot-1.0.0-py3-none-any.whl |
|---|---|
| Size | 94.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c5864a010e799f127417916d833f94980db223891377b0480f070bbb9e95903c
|
|
BLAKE2b-256 checksum How to use checksums |
6246ed03982e18ff1fa6975752e892fd62d4956725b6fb417c425ba3929498ee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for weatherbot 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.