Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

NWS

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

NWS

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

  • 1.3
  • PyPI
  • Socket score

Maintainers
1

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)

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc