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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file NWS-1.2.tar.gz.
File metadata
- Download URL: NWS-1.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
137c3e453b024658e79871ca16dc3a7b3d2ff4a4703375c243be983e11db4ca4
|
|
| MD5 |
6329a29b4c236bc6e40feb7e4a5759d8
|
|
| BLAKE2b-256 |
e38b61c59ed93f8929501066db76c51ff62be944902d1af69e21667cea82b5dc
|
File details
Details for the file NWS-1.2-py3-none-any.whl.
File metadata
- Download URL: NWS-1.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3770d7420172162b489846acf0db3786ef0ae1a34f99ddffeff62b760f1fa818
|
|
| MD5 |
97e81e9a0bc0f7203059d9b2d7a2ba36
|
|
| BLAKE2b-256 |
ea27d134280ef082c1089aa56f48cce65aa2341e68e34057ccd18d547e5a4569
|