11

weather-cli.py

Posted in Weather by nuclearbalm 3187 days ago

Download from here: http://code.google.com/p/weather-cli/

It's a command line weather app written in Python that queries Google's weather API.  It can download the current weather.gif icon and save it locally, just run the script with --help for syntax info or -z zipcode to see everything.

This is an old screenshot, it include humidity & other info is available as well.  I run this as three different GeekTool Geeklets: two scripts as seen below, and a third image that points to ~/.weather.gif that I keep up to date with the -d -p instance.  This way I can have different fonts, etc.

Screenshot

$ weather_cli.py -h

Usage: weather_cli.py [ -a | -d | -f | -l | -p | -s ] -z zipcode
         Example: weather_query.py -d -p ~/weather.gif -z 12543

Options:
  -h, --help            show this help message and exit
  -a, --all             Long listing of the current days weather data
                        (Default)
  -d, --data            List the current days data minus location - Geektool
  -f, --forecast        List the four day forecast
  -l, --location        List location (Weather status for City,ST:) - Geektool
  -p PICTURE, --picture=PICTURE
                        Local filename to download the current weather icon as
                        - Example: ~/weather.gif
  -s, --short           Short listing of the current days weather data
  -z ZIPCODE, --zipcode=ZIPCODE
                        5 digit US zipcode

$ weather_cli.py -l -z 76262

Weather status for Roanoke, TX:

$ weather_cli.py -d -p ~/weather.gif -z 76262

Currently: Partly Cloudy
Temp: 58
Humidity: 46%
Wind: N at 14 mph

$ weather_cli.py -s -z 76262

Weather status for Roanoke, TX:

Currently: Partly Cloudy
Temp: 58
Humidity: 46%
Wind: N at 14 mph

$ weather_cli.py -a -z 76262

Weather status for Roanoke, TX:

Currently: Partly Cloudy
Temp: 58
Humidity: 46%
Wind: N at 14 mph

Mon:
Condition: Windy
High: 65
Low: 41

Tue:
Condition: Partly Cloudy
High: 69
Low: 56

Wed:
Condition: Cloudy
High: 72
Low: 62

Thu:
Condition: Scattered Thunderstorms
High: 76
Low: 44

Comments

Log in to comment or register here.