Skip to content

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.

Notifications You must be signed in to change notification settings

sumitra19jha/WeatherForecastCLI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages