Skip to content

Provide Weather data for various locations in the world.

Notifications You must be signed in to change notification settings

istein1/weather_utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

weather_utils

Example of how to use weather_utils.py

from weather_utils import Weather

Example of setting city variable. Valid values can be found in https://openweathermap.org

city = 'Jerusalem'

Example of setting temperature units variable. Valid values can be:'kelvin', 'fahrenheit', 'celcius'

temp_units = 'celcius'

Create object from Weather class and print weather data

weather_ob = Weather(city, temp_units)

try: if weather_ob.get_weather():

    print("All weather data: %s" % weather_ob.all_data)

    print("Temperature: %s" % weather_ob.temp)

    print("pressure: %s" % weather_ob.pressure)

    print("humidity: %s" % weather_ob.humidity)

    print("Min temperature: %s" % weather_ob.temp_min)

    print("Max temperature: %s" % weather_ob.temp_max)

except WeatherException as e:

print("WeatherException was caught")

print("Error is: %s" % e.value)

About

Provide Weather data for various locations in the world.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages