nokey.weather package

Submodules

nokey.weather.national_weather_service module

class nokey.weather.national_weather_service.NationalWeatherService(use_caching=False, cache_name='nws_cache', backend='sqlite', expire_after=3600)[source]

Bases: object

A class to interact with the National Weather Service API.

base_url

The base URL of the National Weather Service API.

about

A short description of the API.

get_NWS_office_headline_by_headline_id(officeID, headlineID)[source]

Returns a specific news headline for a given NWS office.

Parameters:
  • officeID (str) – NWS office ID.

  • headlineID (str) – Headline record ID.

Returns:

Dictionary containing headline for given NWS office and given headline ID.

Return type:

dict

get_NWS_office_headlines(officeID)[source]

Returns a list of news headlines for a given NWS office.

Parameters:

officeID (str) – NWS office ID.

Returns:

Dictionary containing headlines for given NWS office.

Return type:

dict

get_NWS_office_metadata(officeID)[source]

Returns metadata about a NWS forecast office.

Parameters:

officeID (str) – NWS office ID.

Returns:

Dictionary containing metadata for given NWS office.

Return type:

dict

get_active_alerts()[source]

Returns a collection of currently active weather alerts.

Parameters:

None

Returns:

Inforation on currently active weather alerts

Return type:

dict

get_active_alerts_by_area(area)[source]

Returns active alerts for the given area (state or marine area).

Parameters:

area (str) – State or marine area ID

Returns:

Information of active alerts in the area specified.

Return type:

dict

get_active_alerts_by_region(region)[source]

Returns active alerts for the given marine region ID. Available values : AL, AT, GL, GM, PA, PI.”

Parameters:

region (str) – Marine region ID. Available values : AL, AT, GL, GM, PA, PI.

Returns:

Information of active alerts in the area specified.

Return type:

dict

get_active_alerts_by_zone(zoneID)[source]

Returns active alerts for the given NWS public zone or county.

Parameters:

zoneID (str) – NWS public zone/county identifier

Returns:

Information of active alerts in the zone specified by zoneID.

Return type:

dict

get_active_alerts_count()[source]

Returns the count of currently active weather alerts broken down by various categories.

Parameters:

None

Returns:

Count of currently active weather alerts broke down by categories.

Return type:

dict

get_alert_by_id(ID)[source]

Returns a specific alert record.

Parameters:

ID (str) – Alert identifier.

Returns:

A dictionary containing information about a specific alert.

Return type:

dict

get_alert_types()[source]

Returns a list of alerts types.

Parameters:

None

Returns:

A dictionary containing a list of alert types.

Return type:

dict

get_alerts()[source]

Returns a collection of weather alerts.

Parameters:

None

Returns:

Inforation on weather alerts

Return type:

dict

get_cwsu_advisories(cwsuID)[source]

Returns a list of Center Weather Advisories from a CWSU.

Parameters:

cwsuID (str) – NWS CWSU ID. Available values : ZAB, ZAN, ZAU, ZBW, ZDC, ZDV, ZFA, ZFW, ZHU, ZID, ZJX, ZKC, ZLA, ZLC, ZMA, ZME, ZMP, ZNY, ZOA, ZOB, ZSE, ZTL.

Returns:

Dictionary containing list of Center Weather Advisories from a CWSU.

Return type:

dict

get_cwsu_advisories_by_date_and_seq(cwsuID, date, sequence)[source]

Returns a list of Center Weather Advisories from a CWSU.

Parameters:
  • cwsuID (str) – NWS CWSU ID. Available values : ZAB, ZAN, ZAU, ZBW, ZDC, ZDV, ZFA, ZFW, ZHU, ZID, ZJX, ZKC, ZLA, ZLC, ZMA, ZME, ZMP, ZNY, ZOA, ZOB, ZSE, ZTL.

  • date (str) – (YYYY-MM-DD format) Date of advisory.

  • sequence (int) – Sequence number

Returns:

Dictionary containing list of Center Weather Advisories from a CWSU.

Return type:

dict

get_cwsu_metadata(cwsuID)[source]

Returns metadata about a Center Weather Service Unit.

Parameters:

cwsuID (str) – NWS CWSU ID. Available values : ZAB, ZAN, ZAU, ZBW, ZDC, ZDV, ZFA, ZFW, ZHU, ZID, ZJX, ZKC, ZLA, ZLC, ZMA, ZME, ZMP, ZNY, ZOA, ZOB, ZSE, ZTL.

Returns:

Metadata about a cwsu.

Return type:

dict

get_docs_url()[source]

Returns URL for API docs.

Parameters:

None

Returns:

URL for API documentation.

Return type:

string

get_glossary()[source]

Returns glossary terms.

Parameters:

None

Returns:

A dictionary containing a list of glossary terms and definitions.

Return type:

dict

get_observation_stations_by_gridpoints(wfo, x, y)[source]

Returns a list of observation stations usable for a given 2.5km grid area.

Parameters:
  • wfo (str) – Forecast office ID. Available values : AKQ, ALY, BGM, BOX, BTV, BUF, CAE, CAR, CHS, CLE, CTP, GSP, GYX, ILM, ILN, LWX, MHX, OKX, PBZ, PHI, RAH, RLX, RNK, ABQ, AMA, BMX, BRO, CRP, EPZ, EWX, FFC, FWD, HGX, HUN, JAN, JAX, KEY, LCH, LIX, LUB, LZK, MAF, MEG, MFL, MLB, MOB, MRX, OHX, OUN, SHV, SJT, SJU, TAE, TBW, TSA, ABR, APX, ARX, BIS, BOU, CYS, DDC, DLH, DMX, DTX, DVN, EAX, FGF, FSD, GID, GJT, GLD, GRB, GRR, ICT, ILX, IND, IWX, JKL, LBF, LMK, LOT, LSX, MKX, MPX, MQT, OAX, PAH, PUB, RIW, SGF, TOP, UNR, BOI, BYZ, EKA, FGZ, GGW, HNX, LKN, LOX, MFR, MSO, MTR, OTX, PDT, PIH, PQR, PSR, REV, SEW, SGX, SLC, STO, TFX, TWC, VEF, AER, AFC, AFG, AJK, ALU, GUM, HPA, HFO, PPG, STU, NH1, NH2, ONA, ONP

  • x (int) – Forecast grid X coordinate.

  • y (int) – Forecast grid Y coordinate.

Returns:

Dictionary containing a list of observation stations usable for a given 2.5km grid area.

Return type:

dict

get_observation_stations_by_zone(zoneID)[source]

Returns a list of observation stations for a given zone.

Parameters:

zoneID (str) – NWS public zone/county identifier.

Returns:

Dictionary containing a list of observation stations for a given zkne.

Return type:

dict

get_observations_by_station(stationID)[source]

Returns a list of observations for a given station.

Parameters:

stationID (str) – Observation station ID.

Returns:

Dictionary containing list of observations for a given station.

Return type:

dict

get_radar_queue_metadata(host)[source]

Returns metadata about a given radar queue.

Parameters:

host (str) – LDM host.

Returns:

Dictionary containing metadata for given radar queue.

Return type:

dict

get_radar_server_metadata_by_id(serverID)[source]

Returns metadata about a given radar server.

Parameters:

serverID (str) – Radar server ID.

Returns:

Dictionary containing metadata for given radar server.

Return type:

dict

get_radar_servers()[source]

Returns a list of radar servers.

Parameters:

None

Returns:

A dictionary containing a list of radar servers.

Return type:

dict

get_radar_station_alarms_metadata_by_id(stationID)[source]

Returns metadata about a given radar station alarms.

Parameters:

stationID (str) – Radar station ID.

Returns:

Dictionary containing metadata for given radar station alarms.

Return type:

dict

get_radar_station_metadata_by_id(stationID)[source]

Returns metadata about a given radar station.

Parameters:

stationID (str) – Radar station ID.

Returns:

Dictionary containing metadata for given radar station.

Return type:

dict

get_radar_stations()[source]

Returns a list of radar stations.

Parameters:

None

Returns:

A dictionary containing a list of radar stations.

Return type:

dict

get_radar_wind_profiler_metadata(stationID)[source]

Returns metadata about a given radar wind profiler.

Parameters:

stationID (str) – Profiler station ID.

Returns:

Dictionary containing metadata for given radar wind profiler.

Return type:

dict

get_raw_data_by_gridpoints(wfo, x, y)[source]

Returns raw numerical forecast data for a 2.5km grid area.

Parameters:
  • wfo (str) – Forecast office ID. Available values : AKQ, ALY, BGM, BOX, BTV, BUF, CAE, CAR, CHS, CLE, CTP, GSP, GYX, ILM, ILN, LWX, MHX, OKX, PBZ, PHI, RAH, RLX, RNK, ABQ, AMA, BMX, BRO, CRP, EPZ, EWX, FFC, FWD, HGX, HUN, JAN, JAX, KEY, LCH, LIX, LUB, LZK, MAF, MEG, MFL, MLB, MOB, MRX, OHX, OUN, SHV, SJT, SJU, TAE, TBW, TSA, ABR, APX, ARX, BIS, BOU, CYS, DDC, DLH, DMX, DTX, DVN, EAX, FGF, FSD, GID, GJT, GLD, GRB, GRR, ICT, ILX, IND, IWX, JKL, LBF, LMK, LOT, LSX, MKX, MPX, MQT, OAX, PAH, PUB, RIW, SGF, TOP, UNR, BOI, BYZ, EKA, FGZ, GGW, HNX, LKN, LOX, MFR, MSO, MTR, OTX, PDT, PIH, PQR, PSR, REV, SEW, SGX, SLC, STO, TFX, TWC, VEF, AER, AFC, AFG, AJK, ALU, GUM, HPA, HFO, PPG, STU, NH1, NH2, ONA, ONP

  • x (int) – Forecast grid X coordinate.

  • y (int) – Forecast grid Y coordinate.

Returns:

Dictionary containing the raw numerical forcast data.

Return type:

dict

get_sigmets_by_atsu(atsu)[source]

Returns a list of SIGMET/AIRMETs for the specified ATSU.

Parameters:

atsu (str) – ATSU identifier.

Returns:

Dictionary containing list of SIGMET/AIRMETs for the specified ATSU.

Return type:

dict

get_sigmets_by_atsu_and_date(atsu, date)[source]

Returns a list of SIGMET/AIRMETs for the specified ATSU for the specified date.

Parameters:
  • atsu (str) – ATSU identifier.

  • date (str) – Date (YYYY-MM-DD format)

Returns:

Dictionary containing list of SIGMET/AIRMETs for the specified ATSU and specified date.

Return type:

dict

get_specific_sigmet(atsu, date, time)[source]

Returns a list of SIGMET/AIRMETs for the specified ATSU for the specified date.

Parameters:
  • atsu (str) – ATSU identifier.

  • date (str) – Date (YYYY-MM-DD format)

  • time (str) – Time (HHMM format). This time is always specified in UTC (Zulu) time.

Returns:

Dictionary containing a specific SIGMET/AIRMET.

Return type:

dict

get_station_metadata(stationID)[source]

Returns metadata about a given observation station.

Parameters:

stationID (str) – Observation station ID.

Returns:

Dictionary containing metadata for given station.

Return type:

dict

get_station_observation_by_time(stationID, time)[source]

Returns a single observation.

Parameters:
  • stationID (str) – Observation station ID.

  • time (str) – Timestamp of requested observation.

Returns:

Dictionary containing single observation for a given station at a given time.

Return type:

dict

get_stations()[source]

Returns a list of observation stations.

Parameters:

None

Returns:

A dictionary containing a list of observation stations.

Return type:

dict

get_taf_by_date_time(stationID, date, time)[source]

Returns a single Terminal Aerodrome Forecast..

Parameters:
  • stationID (str) – Observation station ID.

  • date (str) – Date (YYYY-MM-DD format)

  • time (str) Time (HHMM format). This time is always specified in UTC (Zulu) –

Returns:

Dictionary containing TAF.

Return type:

dict

get_tafs_by_station(stationID)[source]

Returns Terminal Aerodrome Forecasts for the specified airport station.

Parameters:

stationID (str) – Observation station ID.

Returns:

Dictionary containing TAFS for given station.

Return type:

dict

get_text_product_by_id(productID)[source]

Returns a specific text product.

Parameters:

productID (str) – Text product ID.

Returns:

Dictionary containing specific text product.

Return type:

dict

get_text_product_locations()[source]

Returns a list of valid text product issuance locations.

Parameters:

None

Returns:

A dictionary containing a list of valid text product issuance locations.

Return type:

dict

get_text_product_locations_by_type(typeID)[source]

Returns a list of valid text product issuance locations for a given product type.

Parameters:

typeID (str) – Text product type ID.

Returns:

Dictionary containing list of valid text product issuance locations for a given type.

Return type:

dict

get_text_product_types()[source]

Returns a list of valid text product types and codes.

Parameters:

None

Returns:

A dictionary containing a list of valid text product types and codes.

Return type:

dict

get_text_product_types_by_location(locationID)[source]

Returns a list of valid text product types for a given issuance location.

Parameters:

locationID (str) – Location ID.

Returns:

Dictionary containing list of valid text product types for a given location.

Return type:

dict

get_text_products()[source]

Returns a list of text products.

Parameters:

None

Returns:

A dictionary containing a list of text products.

Return type:

dict

get_text_products_by_type(typeID)[source]

Returns a list of text products of a given type.

Parameters:

typeID (str) – Text product type ID.

Returns:

Dictionary containing list of text products of given type.

Return type:

dict

get_text_products_by_type_and_location(typeID, locationID)[source]

Returns a list of text products of a given type for a given issuance location.

Parameters:
  • typeID (str) – Text product type ID.

  • locationID (str) – Location ID.

Returns:

Dictionary containing list of text product of a given type for a given issuance location.

Return type:

dict

get_textual_forecast_by_gridpoints(wfo, x, y)[source]

Returns a textual forecast for a 2.5km grid area.

Parameters:
  • wfo (str) – Forecast office ID. Available values : AKQ, ALY, BGM, BOX, BTV, BUF, CAE, CAR, CHS, CLE, CTP, GSP, GYX, ILM, ILN, LWX, MHX, OKX, PBZ, PHI, RAH, RLX, RNK, ABQ, AMA, BMX, BRO, CRP, EPZ, EWX, FFC, FWD, HGX, HUN, JAN, JAX, KEY, LCH, LIX, LUB, LZK, MAF, MEG, MFL, MLB, MOB, MRX, OHX, OUN, SHV, SJT, SJU, TAE, TBW, TSA, ABR, APX, ARX, BIS, BOU, CYS, DDC, DLH, DMX, DTX, DVN, EAX, FGF, FSD, GID, GJT, GLD, GRB, GRR, ICT, ILX, IND, IWX, JKL, LBF, LMK, LOT, LSX, MKX, MPX, MQT, OAX, PAH, PUB, RIW, SGF, TOP, UNR, BOI, BYZ, EKA, FGZ, GGW, HNX, LKN, LOX, MFR, MSO, MTR, OTX, PDT, PIH, PQR, PSR, REV, SEW, SGX, SLC, STO, TFX, TWC, VEF, AER, AFC, AFG, AJK, ALU, GUM, HPA, HFO, PPG, STU, NH1, NH2, ONA, ONP

  • x (int) – Forecast grid X coordinate.

  • y (int) – Forecast grid Y coordinate.

Returns:

Dictionary containing the textual forcast data.

Return type:

dict

get_textual_hourly_forecast_by_gridpoints(wfo, x, y)[source]

Returns a textual hourly forecast for a 2.5km grid area.

Parameters:
  • wfo (str) – Forecast office ID. Available values : AKQ, ALY, BGM, BOX, BTV, BUF, CAE, CAR, CHS, CLE, CTP, GSP, GYX, ILM, ILN, LWX, MHX, OKX, PBZ, PHI, RAH, RLX, RNK, ABQ, AMA, BMX, BRO, CRP, EPZ, EWX, FFC, FWD, HGX, HUN, JAN, JAX, KEY, LCH, LIX, LUB, LZK, MAF, MEG, MFL, MLB, MOB, MRX, OHX, OUN, SHV, SJT, SJU, TAE, TBW, TSA, ABR, APX, ARX, BIS, BOU, CYS, DDC, DLH, DMX, DTX, DVN, EAX, FGF, FSD, GID, GJT, GLD, GRB, GRR, ICT, ILX, IND, IWX, JKL, LBF, LMK, LOT, LSX, MKX, MPX, MQT, OAX, PAH, PUB, RIW, SGF, TOP, UNR, BOI, BYZ, EKA, FGZ, GGW, HNX, LKN, LOX, MFR, MSO, MTR, OTX, PDT, PIH, PQR, PSR, REV, SEW, SGX, SLC, STO, TFX, TWC, VEF, AER, AFC, AFG, AJK, ALU, GUM, HPA, HFO, PPG, STU, NH1, NH2, ONA, ONP

  • x (int) – Forecast grid X coordinate.

  • y (int) – Forecast grid Y coordinate.

Returns:

Dictionary containing the textual hourly forcast data.

Return type:

dict

get_zone_forecast(Type, zoneID)[source]

Returns the current zone forecast for a given zone.

Parameters:
  • Type (str) – Zone type. Available values : land, marine, forecast, public, coastal, offshore, fire, county.

  • zoneID (str) – NWS public zone/county identifier.

Returns:

Dictionary containing zone forecast for a given zone.

Return type:

dict

get_zone_metadata(Type, zoneID)[source]

Returns metadata about a given zone.

Parameters:
  • Type (str) – Zone type. Available values : land, marine, forecast, public, coastal, offshore, fire, county.

  • zoneID (str) – NWS public zone/county identifier.

Returns:

Dictionary containing metadata about a given zone.

Return type:

dict

get_zone_observations(zoneID)[source]

Returns a list of observations for a given zone.

Parameters:

zoneID (str) – NWS public zone/county identifier.

Returns:

Dictionary containing a list of observations for a given zkne.

Return type:

dict

get_zones()[source]

Returns a list of zones.

Parameters:

None

Returns:

A dictionary containing a list of zones.

Return type:

dict

get_zones_by_type(Type)[source]

Returns a list of valid text product types for a given issuance location.

Parameters:

Type (str) – Zone type. Available values : land, marine, forecast, public, coastal, offshore, fire, county.

Returns:

Dictionary containing list of valid text product types for a given location.

Return type:

dict

Module contents