zebpalmer / WeatherAlerts

Python script to parse the National Weather Service 'Cap' Alerts Feed and do interesting things with it.
MIT License
31 stars 14 forks source link

Error running the sample from the documents #15

Open bonelifer opened 3 years ago

bonelifer commented 3 years ago
from weatheralerts import WeatherAlerts

# Alerts by a Samecode
nws = WeatherAlerts(samecodes='005029')
for alert in nws.alerts:
    print (alert.title)

(base) william@william:~/CODE/Weather-NOAA-Alert-Example$ python3.6 w.py

Traceback (most recent call last):
  File "w.py", line 7, in <module>
    nws = WeatherAlerts(samecodes='005029')
  File "/home/william/.local/lib/python3.6/site-packages/weatheralerts/weather_alerts.py", line 27, in __init__
    self.geo = GeoDB()
  File "/home/william/.local/lib/python3.6/site-packages/weatheralerts/geo.py", line 17, in __init__
    self.__same = SameCodes()
  File "/home/william/.local/lib/python3.6/site-packages/weatheralerts/geo.py", line 95, in __init__
    self._load_same_codes()
  File "/home/william/.local/lib/python3.6/site-packages/weatheralerts/geo.py", line 111, in _load_same_codes
    self._cached_same_codes()
  File "/home/william/.local/lib/python3.6/site-packages/weatheralerts/geo.py", line 148, in _cached_same_codes
    self.reload()
  File "/home/william/.local/lib/python3.6/site-packages/weatheralerts/geo.py", line 104, in reload
    self._load_same_codes(refresh=True)
  File "/home/william/.local/lib/python3.6/site-packages/weatheralerts/geo.py", line 109, in _load_same_codes
    self._get_same_codes()
  File "/home/william/.local/lib/python3.6/site-packages/weatheralerts/geo.py", line 121, in _get_same_codes
    code, local, state = str(row).strip().split(',')
ValueError: not enough values to unpack (expected 3, got 1)
madsci1016 commented 3 years ago

I got the same error.