Get weather data from the National Weather Service API
Project description
Python NWS Weather Package
This Python package provides a simple interface for retrieving weather data from the National Weather Service (NWS) API.
Installation
To install this package, simply run the following command:
pip install nws-weather
Usage
First, import the package:
from NWS_Weather import current_weather, predicted_weather
To get the current weather for a given location, use the current_weather
function:
weather = current_weather(station='KJFK')
weather = current_weather(lat=40.64, lon=-73.76)
weather = current_weather(zipcode=11430)
for w in weather:
print(w)
To get the predicted weather for a given location, use the predicted_weather
function:
weather = predicted_weather(gridX=91, gridY=13, gridId='ARX')
weather = predicted_weather(lat=40.64, lon=-73.76)
weather = predicted_weather(zipcode=11430)
for w in weather:
print(w)
Station is the NWS observation station ID. You can find the station ID for your location here.
Lat, Lon is the latitude and longitude of the location you want the weather for.
Zipcode is the zipcode of the location you want the weather for.
GridX, GridY, GridId is the grid coordinates and ID of the location you want the weather for.
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
Built Distribution
Hashes for NWS_Weather-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12b04cc957ed4e669d0875890c5f5a33678bf5ac6aeb6f6974df249670b4d36a |
|
MD5 | 0f8586cebce40687d6bc2fcfd75177ad |
|
BLAKE2b-256 | fc237d5c35caf65f8833a6c9960fc0ec9803533cd65bc4f15ed8e86457151c11 |