This repository contains a Python-based command-line tool for fetching and displaying the current weather forecast for any city. It leverages the OpenWeatherMap API to fetch weather data.
-
Clone this repository using git:
git clone https://github.com/your_username/WeatherForecastCLI.git cd WeatherForecastCLI
-
Install the required Python packages:
pip install -r requirements.txt
-
Create a
.env
file in the root directory and add your OpenWeatherMap API key:API_KEY=your_api_key_here
You can run the weather forecast tool using the following command:
python forecast.py 'City Name'
For example, to get the forecast for New York, you would run:
python forecast.py 'New York'
By default, the country is set to 'us'. If you want to get the forecast for a city in a different country, use the --country flag:
python forecast.py 'London' --country 'uk'