Package weather :: Package services :: Module wunderground
[show private | hide private]
[frames | no frames]

Module weather.services.wunderground

WUnderground.com Publisher

Abstract: The class contained within this module allows python programs to publish weather conditions to the wunderground.com servers. That is, this class encapsulates the wire protocol wunderground.com supports and allows application developers to insulate themselves against changes in the wunderground.com wire protocol.

If the rtfreq parameter is passed to the Publisher constructor, posting of the current conditions will go to the "real time updater" service provided by wunderground.com. The rtfreq optional parameter passed to the constructor is a float that represents the number of seconds between observations.

Usage: >>> publisher = Publisher() >>> publisher.set(30.12, 28.52, 53.0, 44.6, 0.0, time.gmtime(), 0, 0, 0) >>> response = publisher.publish('MyUserName', 'MyPassword') >>> print '%s: %s' % (response.status, response.reason)

Notes on arguments to Publisher.set(): <float> pressure: in inches of Hg <float> dewpt: in Fahrenheit <float> humidity: between 0.0 and 100.0 inclusive <float> tempf: in Fahrenheit <time tuple> dateutc: 9 value time tuple in UTC (e.g. time.gmtime()) <float> windgust: in mph <float> winddir: in degrees, between 0.0 and 100.0 <string> clouds: unknown at this time (email me if you know!) <string> weather: unknown at this time (email me if you know!)

Developers Notes: It appears that even if you provide an invalid username and password, a status of 200, and a reason of "OK" is returned.

Author: Christopher Blunck (chris@wxnet.org) Date: 2006-03-27
Classes
Publisher Publishes weather data to the wunderground.com servers.

Generated by Epydoc 2.0 on Mon Mar 27 23:18:47 2006 http://epydoc.sf.net