pywws.service.windy¶
Upload data to Windy.
Windy is a Czech company providing interactive weather forecasting services worldwide.
Create account: https://stations.windy.com/
API: https://community.windy.com/topic/8168/report-your-weather-station-data-to-windy
Forum discussion: https://community.windy.com/topic/11014/pywws-great-python-software-app-to-send-data-to-windy
Additional dependency: http://docs.python-requests.org/
Example
weather.ini
configuration:[windy] api_key = very.long.string.indeed station_id = [logged] services = ['windy', 'underground'] [live] services = ['windy', 'underground']
Note that you only need to specify your station ID if you have more than one station defined for your API. Windy allows other data, such as the latitude and longitude, to be included in the upload but it’s better to set these by editing your station at https://stations.windy.com/stations.
Classes
ToService (context[, check_params]) |
-
class
pywws.service.windy.
ToService
(context, check_params=True)[source]¶ Bases:
pywws.service.CatchupDataService
-
config
= {'api_key': ('', True, None), 'station_id': ('', False, 'station')}¶
-
interval
= datetime.timedelta(seconds=290)¶
-
logger
= <Logger pywws.service.windy (WARNING)>¶
-
service_name
= 'windy'¶
-
template
= '\n#live#\n#idx "\'dateutc\' : \'%Y-%m-%d %H:%M:%S\',"#\n#wind_ave "\'wind\' : \'%.1f\',"#\n#wind_dir "\'winddir\' : \'%.0f\'," "" "winddir_degrees(x)"#\n#wind_gust "\'gust\' : \'%.2f\',"#\n#hum_out "\'humidity\' : \'%.d\',"#\n#temp_out "\'temp\' : \'%.1f\',"#\n#rel_pressure "\'mbar\' : \'%.1f\',"#\n#calc "dew_point(data[\'temp_out\'], data[\'hum_out\'])" "\'dewpoint\': \'%.1f\',"#\n#calc "rain_hour(data)" "\'precip\': \'%.2f\',"#\n'¶
-
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 yieldNone
, as inpywws.service.copy
.
-
Comments or questions? Please subscribe to the pywws mailing list http://groups.google.com/group/pywws and let us know.