Weather-API-GUI-Tkinter - A weather tool made using tkinter which works by fetching query city weather using an API

Overview

Weather-API-GUI-Tkinter ☁️ ❄️

version- 1️⃣ . 0️⃣ . 0️⃣

This repo contains a weather forecasting tool made using tkinter which works by fetching query made city's weather using an API.

so what is an API?

  • API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you’re using an API.
  • When you use an application on your mobile phone, the application connects to the Internet and sends data to a server. The server then retrieves that data, interprets it, performs the necessary actions and sends it back to your phone. The application then interprets that data and presents you with the information you wanted in a readable way. This is what an API is - all of this happens via API.
  • Coming to our weather api project, Weather APIs are Application Programming Interfaces that provide access to current & historical weather data on a global scale. There are several public weather APIs like OpenWeatherMap API, Dark Sky API, & Visual Crossing Weather API.

Here is a illustration of api:

image1-2

Top 10 Weather api are as follows:

  • OpenWeatherMap API
  • Dark Sky API
  • Weather API
  • Simple Weather API
  • Weather2020 API
  • Air Quality API
  • Weather by Location API
  • Visual Crossing Weather API
  • AccuWeather API
  • AerisWeather API

In this project an APi of OpenWeather is used to request weather of a city by sending a query to the api.
query looks like this:

url :  http://api.openweathermap.org/data/2.5/weather
{"q":cityy_name.get(),'units':'metric','appid':api_key }

in the url the city name along with my api id and unit system are comined and sent as an https request using the request modules's request() method, the output is in the format of json file.

the response from the api looks something like this:

{'coord': {'lon': -71.06, 'lat': 42.36}, 'weather': [{'id': 500, 'main': 'Rain', 'description': 'light rain', 'icon': '10d'}], 'base': 'stations', 
    'main': {'temp': 298.88, 'feels_like': 302.56, 'temp_min': 298.15, 'temp_max': 299.82, 'pressure': 1010, 'humidity': 85}, 'visibility': 10000, 
    'wind': {'speed': 2.24, 'deg': 151, 'gust': 4.47}, 'rain': {'1h': 0.25}, 'clouds': {'all': 82}, 'dt': 1596407271, 'sys': {'type': 3, 'id': 2005683, 
    'country': 'US', 'sunrise': 1596361095, 'sunset': 1596412955}, 'timezone': -14400, 'id': 4930956, 'name': 'Boston', 'cod': 200} 

which is then this data is formatted into the gui application by using appropiate dictionary methods.

The GUI application looks like this:

(the GUi is made using frames,canvas,entry methods in tkinter)

(colors are choosen from colorhunt )

  • Any city around the globe can be sent as query and it's current weather condition data can be retrieved and displayed.

imports used in this project are

from tkinter import *
import tkinter,requests
from tkinter.font import BOLD
from urllib import response
from tkinter import BOTH
from PIL import ImageTk, Image
from io import BytesIO
from cv2 import FONT_HERSHEY_COMPLEX

Not just the weather data, even the icon of the weather condition can be retrieved from openweather api, its free to use and faster compared to other api's.

Note:

  • System must be connected to the internet for the app to work.
  • No spelling mistakes must be made while sening query.
  • Enter city name (not country,continent name) then hit submit.

The main intention behind this project is to learn how to work with api's, gathering/retrieving information from web , formatting and producing it in a GUi application which looks good, minimal and easy to use. Feel free to fork the repo and imporve it by changing ui,colors or add more functionality. You can find detailed code xplanation for every line in comments in source, I will also be posting line to line instructions along with xplanation how to build this application along with other very basic GUi applications in learn-tkinter-with-me repo, do check that and it's been a lot of hardwork, struggle making this app work as intended at the same time look good, a lot of trial and error has been made for the colors to make ui look good so leave a star if u like this project.

Owner
SasiVatsal
open source enthusiast.🧑🏼‍💻 Just a teen interest in unix/linux 💻,android📱platforms, intermediate in python, js, c/c++.
SasiVatsal
A system tray application written in python that will assist you with your keyboard endeavors.

A system tray application written in python that will assist you with your keyboard endeavors. It has features such as abbreviation, email autofill, media control, writing from clipboard ,typing curr

Mach50 1 Dec 15, 2021
Projeto de mini-games de azar com interface gráfica utilizando Python e PySimpleGui.

Gambling Mini jogos de azar unidos em uma mesma interface gráfica, utilizando a linguagem de programação Python em conjunto com a biblioteca de interf

Clayton Garcia da Silva 3 Nov 19, 2021
⏲️ 📙 Animedoro Timer made using tkinter in python

Animedoro Timer ⏲️ 📙 version- 1️⃣ . 0️⃣ . 0️⃣ Hey ! did you ever feel bad for not concentarting enough? , it's not you're mistake, there is a flaw in

SasiVatsal 8 Oct 18, 2022
Basic calculator using Tkinter GUI

Basic calculator using Tkinter GUI

Rogerio Penchel 17 Jan 09, 2022
Write desktop and web apps in pure Python

Flexx Want to stay up-to-date about (changes to) Flexx? Subscribe to the NEWS issue. Introduction Flexx is a pure Python toolkit for creating graphica

flexxui 3.1k Jan 08, 2023
System Tray Icon for PySimpleGUI (the tkinter version). Adds a system tray icon by using pystray and PIL

psgtray Add a System Tray Icon to your tkinter port of PySimpleGUI. Installation via pip Installation is via pip: python -m pip install psgtray or if

PySimpleGUI 38 Dec 30, 2022
Gmail account using brute force attack

Programmed in Python | PySimpleGUI Gmail Hack Python script with PySimpleGUI for hack gmail account using brute force attack If you like it give it

Adrijan 127 Dec 30, 2022
PyQT5 app for LOLBAS and GTFOBins

LOLBins PyQT app to list all Living Off The Land Binaries and Scripts for Windows from LOLBAS and Unix binaries that can be used to bypass local secur

Hamza Megahed 41 Dec 01, 2022
Learn to build a Python Desktop GUI app using pywebview, Python, JavaScript, HTML, & CSS.

Python Desktop App Learn how to make a desktop GUI application using Python, JavaScript, HTML, & CSS all thanks to pywebview. pywebview is essentially

Coding For Entrepreneurs 55 Jan 05, 2023
guietta - a tool for making simple Python GUIs

guietta - a tool for making simple Python GUIs

Alfio Puglisi 1.9k Jan 08, 2023
A simple quiz app using API and GUI

GUI-Quiz-APP It's a simple quiz app using API and GUI.

KALPAK KUMAR DAS 1 Feb 03, 2022
A Python native, OS native GUI toolkit.

Toga A Python native, OS native GUI toolkit. Prerequisites Minimum requirements Toga requires Python 3. Python 2 is not supported. If you're on macOS,

BeeWare 3.3k Dec 31, 2022
A Python based Connect 4 game made with DearPyGUI

Ultimate-Connect-4 A Python based Connect 4 game made with DearPyGUI NOTICE: If you connect to the game server hosted by Jah-On and attempt to send ma

4 Jun 01, 2022
GUIOfTemperatureConverterUsingPython - GUI Of Temperature Converter Using Python

Fahrenheit To Celcius GUI Of Temperature Converter Below Video is the Output Of

SUJITHA RASAMSETTY 0 Mar 06, 2022
A keyboard-driven, vim-like browser based on PyQt5.

qutebrowser is a keyboard-focused browser with a minimal GUI. It’s based on Python and PyQt5 and free software, licensed under the GPL.

qutebrowser 8.4k Jan 01, 2023
Awesome examples for my Sun Valley ttk theme!

Sun Valley ttk theme examples This is the examples repo for my stunning Sun Valley ttk theme! Be sure to start and atch this repo, because I will uplo

rdbende 117 Jan 03, 2023
All you need to learn Tkinter!

Tkinter This repository contains the codes and resources which I used to learn the standard GUI library of Python, Tkinter! Best Tkinter Resources Vid

Samyak Jain 3 May 02, 2022
A simple project used Tkinter module to make a seperate window

Project Title This is a program to run a databse where you can store the general information of poeple. This is a very simple project and i have used

Divyansh Bhardwaj 0 Jun 25, 2022
Basic Alarm Clock using Python.

Basic Alarm Clock using Python.

Samyak Jain 2 Feb 10, 2022
Key Cast - Cast your key presses and mouse clicks on the screen, while casting your favorite application on the screen. Better than the rest.

Key Cast Screen cast your keyboard and mouse clicks in style Project Homepage » View Demo · Report Bug · Request Feature Table of Contents Introductio

Mehul Singh Teya 13 Dec 23, 2022