This Python script uses the National Weather Service API to provide an easy-to-use command-line interface for retrieving hourly weather forecasts for any location. By supplying latitude and longitude coordinates, users can customize the forecast interval and the number of periods to display.
-
Make sure you have Python installed on your system.
-
Clone this repository to your local machine:
git clone https://github.com/your-username/hourly-weather-forecaster.git
- Navigate to the project directory:
cd hourly-weather-forecaster
- Install the required libraries using:
pip install requests
- Run the script with the following command:
python weather_forecaster.py latitude longitude [--interval INTERVAL] [--periods PERIODS]
Example:
python weather_forecaster.py 40.7128 -74.0060 --interval 2 --periods 12
This example fetches the hourly forecast for New York City, with a 2-hour interval for the next 12 periods.