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.1.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.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: NWS-1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 702458fe458e3953c98c86838957b990b90f79e99569e7fdb9e8a65dc591b4ce
MD5 7f270622954316ee3d4976764c20d261
BLAKE2b-256 c869f9455578d6426478e99153aef5a19acb3abb22026cd5d941e876350070b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: NWS-1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10f6384be8704ab2d2f23414e0e773933928bceb1a4733e2f40e88d2d3098793
MD5 9edff7c6e058229d5268e43cc203e319
BLAKE2b-256 f4478c20cece6d3c6f45ce4cd7679c6f0adf607635cd61ea4a3b322b18d58d35

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