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
MediaPlayer-with-PyQt5 - The Multimedia Player with Python and PyQt5

MediaPlayer-with-PyQt5 I made this Multimedia Player with Python and PyQt5, I re

4 Oct 06, 2022
This is a rip off of the classical iPhone Calculator . This project has been made with PyQT5

iPhoneCalcRIP-OFF This is a rip off of the classical iPhone Calculator . This project has been made with PyQT5

Juss Patel 7 May 01, 2022
Neukivy is a collection of neumorphic widgets built with Kivy.

Neukivy is a collection of neumorphic widgets built with Kivy. The library is currently in its initial development so there isn't much yet. But hopefully it will grow into a library you can use to ea

Guhan Sensam 29 Dec 13, 2022
Textual is a TUI (Text User Interface) framework for Python inspired by modern web development.

Textual is a TUI (Text User Interface) framework for Python inspired by modern web development.

Will McGugan 17.1k Jan 08, 2023
Desktop application for Windows/macOS users to rotate through custom, preset, and searched-for collections of backgrounds with scheduling and additional settings

Background Revolution (In Development, Alpha Release) What? This will be an application for users to customize their windows backgrounds by uploading

Daniel Agapov 1 Nov 02, 2021
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
Multi-handle range slider widget for PyQt/PySide

QtRangeSlider The missing multi-handle range slider widget for PyQt & PySide The goal of this package is to provide a Range Slider (a slider with 2 or

Talley Lambert 28 Dec 26, 2022
Criando interfaces gráficas com Python e Qt 6 (PyQt6)

Criando interfaces gráficas com Python e Qt 6 (PyQt6) Qt O Qt é um framework para criação de interfaces gráficas multiplataforma, atualmente ele é des

Renato Cruz 1 Jun 07, 2022
A Minimalistic Backup GUI for your Windows, Mac or Linux

BlobBackup is a minimalistic backup utility for your Windows, Mac or Linux computer. With an excellent engine, extensive storage support, and an easy

283 Nov 30, 2022
MATE Layouts is a small panel layout switching application for the MATE Desktop.

a small panel layout switching application for the MATE Desktop

Wilbur Wetterquarz 6 Oct 14, 2022
Quebra cabeça - Utilizando biblioteca do python: PyQt5

Puzzle 3x3 PyQt5 - Windows Quebra cabeça - Utilizando biblioteca do python: PyQt5 Para testar este quebra cabeça na sua maquina, primeiramente faça o

Matheus Marsal 1 Dec 21, 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
Software com funçoes de A a Z feito no Python

Introdução Iniciante em programação Python, decidi criar um programa com diversas ferramentas de A a Z. Funções Ferramenta de Gerenciamento e Manutenç

João Pedro 1 Jan 26, 2022
A GUI calculator made with tkinter module in python

GUI-Calculator A GUI calculator made with tkinter module in python How to setup the calculator If pygame is not installed, go to terminal and do pip i

Eric Jing 0 Aug 25, 2021
Dear PyGui Extensions is a collection of useful tools, abstractions, and simplification layers built with/for Dear PyGui users.

Dear PyGui Extensions: A collection of useful tools, abstractions, and simplification layers built with/for Dear PyGui users.

Jonathan Hoffstadt 34 Jan 01, 2023
Python code examples on how to create several applications using Dear PyGui.

Python code examples on how to create several applications using Dear PyGui. Includes building and editing a table, as well as visualizing sorting algorithms in a plot.

Alexander H. 7 Sep 15, 2022
TextTUI is a set of extensions to the Textual and Textual-Inputs libraries

TextTUI is a set of extensions to the Textual and Textual-Inputs libraries. Currently a Work in Progress that is based on the 0.1.14 branch of

3 Feb 10, 2022
Win32mica: a simple module to add the Mica effect on legacy python windows.

Win32mica (aka PyMica): A simple module to add the Mica effect on legacy python windows The aim of this project is to apply the Mica effect on python

Martí Climent 40 Dec 13, 2022
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
python+PySimpleGUI+pyserial+threading

GUI_pyserial python+PySimpleGUI+pyserial+threading 功能 1.利用PySimpleGUI制作图形用户界面 2.利用threading实现多线程调用pyserial处理串口通信 模块版本 PySimpleGUI 4.46.0 pyserial 3.5

2 Dec 27, 2022