A command-line tool for fetching and displaying weather information
Project description
WeatherWhisper 🌦️
WeatherWhisper is a lightning‑fast, cross‑platform CLI for real‑time weather data and five‑day forecasts—no browser, no bloat. Powered by the free OpenWeatherMap API.
📑 Table of Contents
Features
- Current conditions & 5‑day / hourly forecast for any city or
lat,lon - Metric or Imperial units (
-u metric|imperial) - ANSI colour themes that match temperature & conditions (toggle with
--no-color) - ASCII art icons for common weather types (toggle with
--no-ascii) - Output views: brief, detailed, json, forecast
- Save unlimited favourites for one‑command lookup
- Transparent on‑disk caching to reduce API calls
- Sunrise / sunset, wind, humidity, pressure, visibility, clouds
- Extensible plug‑in architecture (see Roadmap)
Installation
pip install --upgrade weatherwhisper # Python ≥ 3.7
First launch creates ~/.weatherwhisper/config.ini.
Alternate Install
git clone https://github.com/danushgopinath/weatherwhisper.git
cd weatherwhisper
python -m venv venv && source venv/bin/activate
pip install -e .
Get an API Key
- Sign up at https://openweathermap.org/api.
- Copy the 32‑character key.
- One‑time setup:
weatherwhisper config --api-key YOUR_KEY
The key is stored in config.ini so you only set it once.
Usage
Command Reference
| Command | Purpose | Notes | ||
|---|---|---|---|---|
current <location> |
Current conditions | City name or lat,lon |
||
forecast <location> |
5‑day / 3‑hour forecast | Same locations as above | ||
| `favorites add | list | remove` | Manage favourites | 1st favourite is the default location |
| `config show | set` | View or change config | Any flag can be saved as default |
Run weatherwhisper --help or <command> --help for every flag.
Common Flags
-u, --units metric|imperial– Choose °C/m or °F/mi-f, --format brief|detailed|json|forecast– Output view--no-color– Disable ANSI colours (logs & scripts)--no-ascii– Hide ASCII weather icons--cache <minutes>– Override default cache TTL
Output Formats
| View | Example |
|---|---|
| Brief | |
| Forecast | |
| JSON | { "temp": 15.3, "condition": "Rain" } |
Configuration
~/.weatherwhisper/config.ini (created on first run):
[general]
api_key = YOUR_KEY_HERE
units = metric
color = true
ascii = true
cache_minutes = 15
Edit by hand or use the CLI:
weatherwhisper config set --units imperial --no-color
weatherwhisper config show
Caching & Rate Limits
- All responses are cached on disk for 15 minutes by default.
- Cache is keyed by endpoint + location + units.
- Pass
--cache 0to force a live API request.
This keeps most users well below the free‐tier limit of 60 calls / minute.
Examples
# Brief, coloured output
weatherwhisper current "Paris"
# JSON for scripting
weatherwhisper current "51.5074,-0.1278" -f json | jq .temp
# Forecast grid with no ASCII art
weatherwhisper forecast "Tokyo" --no-ascii
# Use the first favourite automatically
weatherwhisper current
Development
📁 Repo layout
weatherwhisper/
├─ images/ # PNG assets (banner, output samples)
├─ __init__.py
├─ api.py # API request & response logic
├─ cli.py # Main CLI entry point
├─ config.py # Config file parsing & CLI setters
├─ formatter.py # Output formatting (color, ASCII)
LICENSE
pyproject.toml
setup.py
README.md
### Set Up Dev Env
git clone https://github.com/danushgopinath/weatherwhisper.git
cd weatherwhisper
python -m venv venv && source venv/bin/activate
pip install -e ".[dev]" # pytest, ruff, black, pre‑commit
pre-commit install
Run from source:
python -m weatherwhisper current "London"
Tests:
pytest -q
Roadmap
- 🔌 Plugin system – drop‑in providers (AccuWeather, WeatherKit…)
- 📈 Historical weather (paid API)
- 🚨 Severe weather alerts
- 📍 Auto‑detect location (IP/GPS)
- 🖼️ GUI wrapper (Tkinter / Electron)
Track progress in the project board.
Contributing
- Fork → clone → create a feature branch.
pre-commit install(runs black, ruff, & tests automatically).- Write or update tests.
- Open a Pull Request with a clear description.
All feedback & PRs are welcome—check outstanding issues or open a new one.
License
MIT © 2025 Danush Gopinath
Made with ☕ and a love of clouds.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file weatherwhisper-0.1.2.tar.gz.
File metadata
- Download URL: weatherwhisper-0.1.2.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
803fbb2812d4c49a36558d26df7a688edd80ee9947364bea1ad9c682b1a3fa82
|
|
| MD5 |
71709e669317f00f085b4bc892603263
|
|
| BLAKE2b-256 |
19d3e976222ec881b3f340f0eff9c88997d8bc3edcb60b488fdbe174ef455e9b
|
File details
Details for the file weatherwhisper-0.1.2-py3-none-any.whl.
File metadata
- Download URL: weatherwhisper-0.1.2-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8fd5a60f0100d562f45957c73f0cc4fab89778e352feac95bf4da64db7b656a1
|
|
| MD5 |
3bde77b357eba83fc90b4948a8458e1b
|
|
| BLAKE2b-256 |
5d548cce409e204d7cb0d4b9937beb2caf93d6ee0a93d8850ad21e39f017de08
|