def _etl()

in cloud-run-alwayson-cpu-weather-advisory/python/main.py [0:0]


def _etl(advisory, state):
    'extract/format relevant weather alert data'
    prop = advisory['properties']
    return {
        'area':         prop['areaDesc'],
        'headline':     prop['parameters']['NWSheadline'][0] \
                if 'NWSheadline' in prop['parameters'] else prop['headline'],
        'effective':    prop['effective'],
        'expires':      prop['expires'],
        'instrutions':  prop['instruction'].replace('\n', ' ') \
                if prop['instruction'] else '(none)'
    }