Skip to main content

Obtain local weather information based on zipcode.

Project description

Weather Wise

Overview

Get the current weather forecast and other weather related information from a zipcode. This module uses the U.S. Census 2022 Gazetteer (Zip Code Tabulation Areas). The original file has been modified to JSON.

Usage

import json
from weather_wise.weather_wise import WeatherWise

weather = WeatherWise("32904")

# Internal weather methods.
print(weather._load_json_data())
print(weather._get_latitude_longitude())
print(weather._get_weather_forecast_url())
print(json.dumps(weather._get_weather_data(), indent=2))

# Get the short forecast.
short_forecast = weather.get_short_forecast()
print(short_forecast)

# Get the temperature in fahrenheit.
temperature_in_fahrenheit_with_unit = weather.get_temperature_in_fahrenheit(temperature_unit=True)
temperature_in_fahrenheit = weather.get_temperature_in_fahrenheit()
print(temperature_in_fahrenheit_with_unit)
print(temperature_in_fahrenheit)

# Get the temperature in celsius.
temperature_in_celsius_with_unit = weather.get_temperature_in_celsius(temperature_unit=True)
temperature_in_celsius = weather.get_temperature_in_celsius()
print(temperature_in_celsius_with_unit)
print(temperature_in_celsius)

# Get the probability of precipitation.
probability_of_precipitation_with_unit = weather.get_probability_of_precipitation(percentage_unit=True)
probability_of_precipitation = weather.get_probability_of_precipitation()
print(probability_of_precipitation_with_unit)
print(probability_of_precipitation)

# Get the relative humidity.
relative_humidity_with_unit = weather.get_relative_humidity(percentage_unit=True)
relative_humidity = weather.get_relative_humidity()
print(relative_humidity_with_unit)
print(relative_humidity)

# Get the wind speed.
wind_speed = weather.get_wind_speed()
wind_speed_without_unit = weather.get_wind_speed(wind_unit=False)
print(wind_speed)
print(wind_speed_without_unit)

# Get the wind direction.
wind_direction = weather.get_wind_direction()
print(wind_direction)

References

TODO

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

weather_wise-0.1.7.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

weather_wise-0.1.7-py3-none-any.whl (1.5 MB view details)

Uploaded Python 3

File details

Details for the file weather_wise-0.1.7.tar.gz.

File metadata

  • Download URL: weather_wise-0.1.7.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-40-generic

File hashes

Hashes for weather_wise-0.1.7.tar.gz
Algorithm Hash digest
SHA256 18ff48a84215d038798ae7b8f17260e0d42d81770b6494ce2774b43208b04d2a
MD5 0ee6065085f33c0f199405765e133100
BLAKE2b-256 9a3010ac4657c3a308db85bedf3ce93f24b1cf53ca25ff94bff705d88960ace5

See more details on using hashes here.

File details

Details for the file weather_wise-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: weather_wise-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.8.0-40-generic

File hashes

Hashes for weather_wise-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 3fdc43cd467c117c28ac0a6334663c76fc110cf3c2627f03079ef3cb45cc582b
MD5 a14542a607c0d1cbb73346bae8172c00
BLAKE2b-256 b8c4439021091c83e5b039cefa38a7ab600ff69a59f670147785358ce41442d5

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