Working on a command line all day, sometimes I really don't want to leave it. Since I fly fairly often, I've been wanting a way to grab the METAR and TAF for a given airport from the command line, but never took the time to sit down and write a script to do it until this weekend.

The usage is fairly simple. To get the METAR for an airport, the command looks like this:
$ aviation_weather -a KWDR -m

and the output looks like this:

METAR for Barrow County Airport:

KWDR 071455Z AUTO 00000KT 10SM CLR 13/06 A3041 RMK AO1 AO1

for a TAF, just change metar to taf and you get this:

$ aviation_weather -a KAHN -t
TAF for Athens/ben Epps Airport:

TAF issued at: 071355Z
0714/0812 16004KT P6SM FEW004 SCT200
TEMPO 0714/0715 BKN004
FM071600 17008KT P6SM SCT045 BKN180
FM080200 11005KT P6SM FEW250
FM081000 00000KT P6SM SCT012
Flight Rules: VFR

If you want a more human readable format, just add -s to the command and you'll get a human readable summary like this:

$ aviation_weather -a kand -m -s
METAR for Anderson Regional Airport:

Winds WSW-240 at 05kt, Vis 10sm, Temp 12C, Dew 07C, Alt 30.39inHg, Sky clear

Full Usage:

usage: aviation_weather [-h] -a AIRPORT [-t] [-m] [-s]

Get Airport Weather Information

optional arguments:
  -h, --help            show this help message and exit
  -a AIRPORT, --airport AIRPORT
                        ICAO Airport Code
  -t, --taf             Display TAF
  -m, --metar           Display METAR
  -s, --summary         Show Summary Info

Here's the source:

(You'll need to save this somewhere in $PATH and make it executable.)

If you have any suggestions, questions, or comments, please feel free to leave them below.