Created
April 20, 2014 20:35
-
-
Save tehmaze/11124608 to your computer and use it in GitHub Desktop.
WX report generator for PyMultimonAPRS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
import pywapi | |
import sys | |
import time | |
LOCATION_ID = sys.argv[1] | |
wxs = pywapi.get_weather_from_weather_com('NLXX0250', 'metric') | |
cur = wxs['current_conditions'] | |
out = dict( | |
timestamp=int(time.time()), | |
wind=dict( | |
gust=0, | |
direction=int(cur['wind']['direction']), | |
speed=float(cur['wind']['speed']), | |
), | |
pressure=float(cur['barometer']['reading']), | |
humidity=int(cur['humidity']), | |
temperature=float(cur['temperature']), | |
) | |
print json.dumps(out, indent=4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment