This Python script fetches weather data from the OpenWeatherMap API and displays it in a beautiful format using dynamic ASCII art. The output includes colorful weather stats, including temperature, humidity, and wind speed, and is formatted with random ASCII styles such as figlet or cowsay/cowthink. This provides a fun and visually appealing way to check the weather.
- 🌍 Fetches weather data using the OpenWeatherMap API.
- ☁️ Displays the weather stats in a clean, readable format, including:
- 🌡️ Temperature (in Fahrenheit)
- 💧 Humidity
- 🌬️ Wind Speed
- 🎨 Dynamic ASCII Art: Displays the word "Weather" in a random style using:
figletwith a random font from available fonts.cowsay/cowthinkwith random characters (like cow, dragon, tux, moose, and hellokitty).
- 🌈 Colorful Output: Weather stats are shown in bright colors for clarity.
- Python 3.x
- Python modules:
requests,subprocess,os, andrandom - External utilities:
figlet,cowsay,cowthink
- Install
figletandcowsayfor full functionality:- On Ubuntu/Debian:
sudo apt install figlet cowsay
- On macOS (using Homebrew):
brew install figlet cowsay
- On Arch Linux:
sudo pacman -S figlet cowsay
- On Ubuntu/Debian:
-
Clone or download the repository to your local machine.
-
Install Python dependencies (if not already installed):
pip install requests
-
Ensure
figletandcowsayare installed for full functionality (if they aren't already installed on your system).
-
Run the script:
python weather_app.py
-
Enter the city name when prompted to get the current weather for that city.
Example:
Enter city name: London -
The weather information will be displayed in a colorful format, with ASCII art at the top.
_ __ __ _
/ | \ \ / / _ _ | |
| | __\ \_/ /__| |_| | | |
| | / __ _/ __| | | |
|_| /_/ \_/\__ \____/ |_|
Weather Stats for London, GB:
Description: Light rain
Temperature : 55.9 °F
Humidity: 72%
Wind Speed: 4.56 mph