sumitra19jha / WeatherForecastCLI

A command-line tool developed in Python that fetches and displays the current weather forecast for any city. This tool leverages the OpenWeatherMap API to retrieve weather data. The project demonstrates effective API usage, data parsing, error handling, and environment configuration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WeatherForecastCLI

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.

Table of Contents

Installation

  1. Clone this repository using git:

    git clone https://github.com/your_username/WeatherForecastCLI.git
    cd WeatherForecastCLI
  2. Install the required Python packages:

    pip install -r requirements.txt
  3. Create a .env file in the root directory and add your OpenWeatherMap API key:

    API_KEY=your_api_key_here

Usage

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'

About

A command-line tool developed in Python that fetches and displays the current weather forecast for any city. This tool leverages the OpenWeatherMap API to retrieve weather data. The project demonstrates effective API usage, data parsing, error handling, and environment configuration.


Languages

Language:Python 100.0%