pywws.service.temperaturnu

Upload current temperature to temperatur.nu.

temperatur.nu is a Swedish web site that shows the current temperature in many places.

You receive the hash value from the temperatur.nu admins during sign up. It looks like d3b07384d113edec49eaa6238ad5ff00.

Classes

ToService(context[, check_params])
class pywws.service.temperaturnu.ToService(context, check_params=True)[source]

Bases: pywws.service.LiveDataService

config = {'hash': ('', True, 'hash')}
logger = <Logger pywws.service.temperaturnu (WARNING)>
service_name = 'temperaturnu'
template = '#live##temp_out "\'t\': \'%.1f\',"#'
session()[source]

Context manager factory function for a batch of one or more uploads.

This makes it easy to ensure any resources such as an internet connection are properly closed after a batch of uploads. Use the contextlib.contextmanager() decorator when you implement this method.

For a typical example, see the source code of the pywws.service.openweathermap module. If your upload can’t benefit from a session object yield None, as in pywws.service.copy.

valid_data(data)[source]
upload_data(session, prepared_data={})[source]

Upload one data set to the service.

Every data service class must implement this method.

Parameters:
  • session (object) – the object created by session(). This is typically used to communicate with the server and is automatically closed when a batch of uploads has finished.
  • prepared_data (dict) – a set of key: value pairs to upload. The keys and values must all be text strings.

Comments or questions? Please subscribe to the pywws mailing list http://groups.google.com/group/pywws and let us know.