Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#This module was written primarily by Vinayak Sareen and edited slightly by Humza Shahid for GUI integration.
#To see Vinayak's original work, compare this file with the other Weather.py in this repository. This Weather.py contains Humza's changes.
import requests
'''Function to get data from openweather.org'''
def get_User_city(User_city,User_Country):
Weather_Api_Link = 'http://api.openweathermap.org/data/2.5/weather?APPID=d98cf0f33972375849da99fef900c4f8&units=metric&q='
Url = Weather_Api_Link + User_city + "&" + User_Country
Jasondata = requests.get(Url).json()
return Jasondata
#Data Sorting and Displaying
def Data_Sorting(Users_city,Users_country):
json_data = get_User_city(Users_city,Users_country) # Fuction calling
Minimum_temp = json_data['main']['temp_min']
Maximum_temp = json_data['main']['temp_max']
Humidity = json_data['main']['humidity']
Description = json_data['weather'][0]['description']
return Minimum_temp, Maximum_temp, Description