Skip to main content

A module that uses the National Weather Service's API to get weather data meaning no need for an account, or API token.

Project description

NWS

A module that uses the National Weather Service's API to get weather data meaning no need for an account, or API token.

Important

This program is not responsible if weather data is innacurate, nor should you rely on this program for emergency weather alerts!

Install

pip install NWS

Setup

Everyscript must start with the initiate API function. This requires you to put your applications name and a email to contact you. This is recommended by the national weather service for a better experience, but you can use the BypassInitiate function to skip this.

Example on how to Initiate API

import NWSweather as weather

#Location of NOAA headquarters in Washington DC
latitude = "38.89355704224317"
longitude = "-77.033268223003"

weather.InitiateAPI("AppName", "Email")
print(weather.GetCurrentTemperature(latitude, longitude))

Example on how to Bypass API

import NWSweather as weather

#Location of NOAA headquarters in Washington DC
latitude = "38.89355704224317"
longitude = "-77.033268223003"

weather.BypassInitiate()
print(weather.GetCurrentTemperature(latitude, longitude))

#Documentation This is all the functions avaiable to you

Get Hourly Forecast Returns the hourly forecast data from the NWS in a dictionary.

import NWSweather

#Location of NOAA headquarters in Washington DC
latitude = "38.89355704224317"
longitude = "-77.033268223003"
weather.InitiateAPI("AppName", "Email")

NWSweather.GetHourlyForecast(latitude, longitude)

Get Current Forecast Returns the currently predicted forecast data from the NWS in a dictionary.

import NWSweather

#Location of NOAA headquarters in Washington DC
latitude = "38.89355704224317"
longitude = "-77.033268223003"
weather.InitiateAPI("AppName", "Email")

NWSweather.GetCurrentForecast(latitude, longitude)

Get Current Conditions Returns the currently predicted conditions data from the NWS in a dictionary.

import NWSweather

#Location of NOAA headquarters in Washington DC
latitude = "38.89355704224317"
longitude = "-77.033268223003"
weather.InitiateAPI("AppName", "Email")

NWSweather.GetCurrentConditions(latitude, longitude)

Get Current Temperature Returns the currently predicted temperature from the NWS.

import NWSweather

#Location of NOAA headquarters in Washington DC
latitude = "38.89355704224317"
longitude = "-77.033268223003"
weather.InitiateAPI("AppName", "Email")

NWSweather.GetCurrentTemperature(latitude, longitude)

Get Current Wind Data Returns the currently predicted wind data from the NWS in a dictionary.

import NWSweather

#Location of NOAA headquarters in Washington DC
latitude = "38.89355704224317"
longitude = "-77.033268223003"
weather.InitiateAPI("AppName", "Email")

NWSweather.GetCurrentWindData(latitude, longitude)

Get Current Weather Alerts Returns any active weather alert data in a dictionary, and will return null if no alerts.

import NWSweather

#Location of NOAA headquarters in Washington DC
latitude = "38.89355704224317"
longitude = "-77.033268223003"
weather.InitiateAPI("AppName", "Email")

NWSweather.GetWeatherAlerts(latitude, longitude)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NWS-1.3.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

NWS-1.3-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file NWS-1.3.tar.gz.

File metadata

  • Download URL: NWS-1.3.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for NWS-1.3.tar.gz
Algorithm Hash digest
SHA256 746cc9ea054c138baf309988818439edce4325d881b8f61238b6827af1cb386e
MD5 380a2cd66f3bf6564db355b76946438f
BLAKE2b-256 7083f137972f821b8a7a155306c0d4eee4ad583668b05f9581f4a2d9a7940bf8

See more details on using hashes here.

File details

Details for the file NWS-1.3-py3-none-any.whl.

File metadata

  • Download URL: NWS-1.3-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.1

File hashes

Hashes for NWS-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 35f5932abe16e0fb4d9b4ba5a459e146949a2a48440b5da54edd822fa1e9e133
MD5 7988780a6025df2248a532960cd5bc38
BLAKE2b-256 7fcda7dde7abc1ab4cf33c94a91131816ac4f5e82719cc2eaa1bc8157dc8895a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page