Skip to content
 
 

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather CLI

 _       __           __  __              ________    ____
| |     / /__  ____ _/ /_/ /_  ___  _____/ ____/ /   /  _/
| | /| / / _ \/ __ `/ __/ __ \/ _ \/ ___/ /   / /    / /  
| |/ |/ /  __/ /_/ / /_/ / / /  __/ /  / /___/ /____/ /   
|__/|__/\___/\__,_/\__/_/ /_/\___/_/   \____/_____/___/   

A command-line interface application to check weather information for any city directly from your terminal.

Features

  • Get current weather information for any city
  • View temperature details in metric units
  • Check humidity levels
  • See sunrise and sunset times for any location
  • Generate ASCII art with customizable fonts

Prerequisites

  • python 3.10 or higher
  • OpenWeatherMap API key

Installation

  1. Clone this repository
git clone https://github.com/yourusername/weather-cli.git
cd weather-cli
  1. Install required dependencies
pip install -r requirements.txt

Usage

Windows

Run the application using the batch script:

cd weather-cli\bin
run.bat

PowerShell

Alternatively, run using PowerShell:

cd weather-cli\bin
.\run.ps1

Linux/Mac

For Linux and Mac users, run the following command:

cd weather-cli/bin
./run.sh

When the application starts, you will see the ASCII art title and a prompt:

Prompt🧭>> 

Available Commands

  • hi - Start the weather retrieval process (this is the main entry point)
  • temperature - Display temperature information for a city
  • humidity - Show humidity information for a city
  • suninfo - Display sunrise and sunset times for a city
  • art <text> [--font <font_name>] - Generate ASCII art from text
  • help - Display available commands and their descriptions
  • exit - Exit the application

Examples

Prompt🧭>> hi
City's Name: London
Weather in London: Clear Sky
Temperature: 15°C
Humidity: 76%
Wind: 3.6 m/s

Prompt🧭>> temperature
City's Name: Tokyo
Current Temperature: 25°C
Feels Like: 26°C
Min Temperature: 23°C
Max Temperature: 27°C

Prompt🧭>> humidity
City's Name: New York
Humidity: 65%
Pressure: 1013 hPa

Prompt🧭>> suninfo
City's Name: Sydney
Sunrise: 05:48 AM
Sunset: 07:52 PM

Prompt🧭>> art Hello --font slant
   __  __     ____           
  / / / /__  / / /___       
 / /_/ / _ \/ / / __ \      
/ __  /  __/ / / /_/ /      
/_/ /_/\___/_/_/\____/

API Key

This application uses the OpenWeatherMap API. You'll need to get your own API key from OpenWeatherMap and add it to the config.py file. For reasons, I decided to remove the default API key in the repository.

# config.py
API_KEY = "your_api_key_here"

Dependencies

  • requests
  • pyfiglet (for ASCII art generation)

Contributing

Contributions, issues, and feature requests are welcome!

🙏 ziverch for original project at repository

About

A command line tool to view the weather.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages