Skip to content

alihamzza04/weather_CLi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather CLI

A simple command-line weather application written in Rust that fetches real-time weather data from the OpenWeatherMap API.

Features

  • Real-time weather information for any city worldwide
  • Displays temperature, humidity, pressure, and wind speed
  • Color-coded output based on weather conditions
  • Temperature-based emoji indicators
  • Interactive CLI with continuous search capability

Prerequisites

  • Rust (latest stable version)
  • OpenWeatherMap API key

Installation

  1. Clone the repository:
git clone https://github.com/alihamzza04/weather_CLi.git
cd weather_CLi
  1. Build the project:
cargo build --release
  1. Run the application:
cargo run

Or run the binary directly:

./target/release/weather_cli

Usage

  1. Start the application
  2. Enter the city name when prompted
  3. Enter the country code (e.g., US, UK, PK, IN)
  4. View the weather information displayed with color coding
  5. Press y to search for another city or any other key to exit

Example Output

Welcome to the Weather CLI
Please Enter the name of the City You want to search for:
Lahore
Please Enter the country code (e.g., US, UK, PK):
PK
Weather in Lahore: smoke 🌤️
        > Temperature: 22.0°C,
        > Humidity: 64.0%,
        > Pressure: 1008.0 hPa,
        > Wind Speed: 1.0 m/s,
Do You want to search for another city? (y/n)

Dependencies

  • reqwest - HTTP client for fetching weather data
  • serde - JSON deserialization
  • colored - Terminal color output

API Key

The application uses OpenWeatherMap API. You'll need to obtain an API key from OpenWeatherMap and replace the key in the source code.

License

MIT

About

Fast & interactive Rust command-line app that fetches real-time weather from OpenWeatherMap and prints temperature, humidity, pressure, and wind speed with color-coded output and temperature-based emojis.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages