Below you’ll find the documentation for the various classes and methods in WeatherAlerts.
Note
This page is dynamically generated from the documentation written into the code
This program is free software you can redistribute it and or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Alerts object that controls interaction with the samecodes and capparser classes/methods. Pass state=’’ or geocodes=’samecodes_list’ to change which feed is being parsed passing a list of samecodes will determine if they are in the same state and pick the correct feed or use the US feed if they’re in different states
returns alerts for given county, state
returns alerts for a given SAME code
returns json object of all alerts on specified feed (National feed by default)
manually load the cap feed/alerts
returns python object of all alerts for specified feed(National by default)
sets state, reloads alerts unless told otherwise
print all alerts for a given state
TODO: not used yet sets target areas to be used in all limiting functions
Class to fetch and load the NWS CAP/XML Alerts feed for the US or a single state if requested if an instance of the SameCodes class has already been (to do a geo lookup), you can pass that as well to save some processing
returns all alerts on feed
check age of alerts in this object, reload if past max cache time
Reload alerts bypassing cache
Interact with samecodes object and other geolocation data that will be added soon
Returns all states for a given list of SAME codes Shouldn’t be used to determine feed scope, please use getfeedscope()
Given multiple SAME codes, determine if they are all in one state. If so, it returns that state. Otherwise return ‘US’. This is used to determine which NWS feed needs to be parsed to get all alerts for the requested SAME codes
Given a SAME code, return the state that SAME code is in
returns full location given samecode or county and state. Returns False if not valid. currently locations are a dictionary, once other geo data is added, they will move to a location class/obj
Given County, State return the SAME code for specified location. Return False if not found
Is used to download, parse and cache the SAME codes data from the web. All interaction with the SAME codes data should be done in the GeoGB classy
force refresh of Same Codes (mainly for testing)
public method to return the same codes list
return alert type for a given alert