In [1]:
import logging
logging.basicConfig(level=logging.DEBUG)
import pipecat.http
import pipecat.limit
import pipecat.record
import pipecat.utility
import pipecat.device.weather
import pipecat.xml
In [2]:
pipe = pipecat.http.get("https://aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&requestType=retrieve&format=xml&hoursBeforeNow=3&mostRecent=true&stationString=KAEG")
pipe = pipecat.xml.parse(pipe)
pipe = pipecat.device.weather.metars(pipe)
pipe = pipecat.utility.add_timestamp(pipe)
pipe = pipecat.limit.count(pipe, count=1)
for record in pipe:
pipecat.record.dump(record)
In [ ]: