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 simple one-line quick entry GUI for your Obsidian daily notes in markdown format.

Quick-note-entry-for-Obsidian A simple one-line quick entry GUI for your Obsidian daily notes in markdown format. Log your day quickly with this simpl

Adrian Papineau 22 Oct 04, 2022
A GUI for designing Python GUI's for PySimpleGUI.

SimpleGUIBuilder A GUI for designing Python GUI's for PySimpleGUI. Installation There is none :) just download the file from a release and run it. Don

Miguel Martins 65 Dec 22, 2022
PyQt QGraphicsView with selection box. User can move vertical border of the box horizontally.

pyqt-horizontal-selection-square-graphics-view PyQt QGraphicsView with selection box. User can move vertical border of the box horizontally. Requireme

Jung Gyu Yoon 3 Nov 07, 2022
This is the new and improved Plex Automatic Pre-roll script with a GUI

Plex-Automatic-Pre-roll-GUI This is the new and improved Plex Automatic Pre-roll script with a GUI! It should be stable but if you find a bug please l

164 Nov 04, 2022
Verify file hashes of downloaded files easily in a GUI

HASH-verify Verify file hashes of downloaded files easily in a GUI What it does... This gui based Python3 app calculates 3 types of file hashes and ca

Christian Richter-Pedersen 10 Dec 13, 2022
A small pomodoro GUI for Windows/Linux created in Python with PyQt5.

Pomodoro A small pomodoro GUI for Windows/Linux created with PyQt5. Features The "Timer" tab allows you to set your desired work and rest times aswell

Burak Martin 81 Dec 28, 2022
A simple, yet powerful web GUI to manage your Wireguard server, powered by Flask.

Linguard Linguard aims to provide a clean, simple yet powerful web GUI to manage your WireGuard server, and it's powered by Flask. Read the docs for f

Jose Antonio Mazón San Bartolomé 111 Jan 07, 2023
Basic calculator using Tkinter GUI

Basic calculator using Tkinter GUI

Rogerio Penchel 17 Jan 09, 2022
Useful PDF-related productivity tool.

Luftmensch 1.4.7 (Español) | 1.4.3 (English) Version 1.4.7 (Español) released in October 2021. Version 1.4.3 (English) released in September 2021. 🏮

8 Dec 29, 2022
Advanced GUI Calculator with Beautiful UI and Clear Code.

Advanced GUI Calculator with Beautiful UI and Clear Code.

Mohammad Dori 3 Jul 15, 2022
A tf publisher gui tool for ROS, which publish /tf_static message. The software is based on PyQt5.

tf_publisher_gui for ROS Introduction How to use cd catkin_ws/src git clone https://github.com/yinwu33/tf_publisher_gui.git cd catkin_ws catkin_make s

yinwu33 7 Dec 28, 2022
GUI app to read settings and stats from Cloudflare WARP CLI for Linux, and change some settings

warp-cli-gui GUI app to read settings and stats from Cloudflare WARP CLI for Linux, and change some settings. Description Python program that will int

Danie 6 Nov 01, 2022
A quick GUI script to pseudo-anonymize patient videos for use in the GRK

grk_patient_sorter A quick GUI script to pseudo-anonymize patient videos for use in the GRK. Source directory — the highest level folder that will be

Peter Somers 1 Dec 09, 2021
A python Script For Taking Screenshot Of Windows

PyShot A Python Script For Taking Screenshot Of Windows Disclaimer This tool is for educational purposes only ! Don't use this to take revenge I will

Nazim Cp 2 Jun 22, 2022
A GUI frontend developed in Python3 for simple admin tasks on MySQL-Server running on the localhost

A GUI frontend developed in Python3 for simple admin tasks on MySQL-Server running on the localhost. Developed for my CS School Project.

1 May 29, 2022
Declarative User Interfaces for Python

Welcome to Enaml Enaml is a programming language and framework for creating professional-quality user interfaces with minimal effort. What you get A d

1.4k Jan 07, 2023
This was my test project when i started to learn Python Tkinter. Its the simplest interface possible.

Rock-Paper-Scissors-Game- Project Description: This was my test project when i started to learn Python Tkinter. Its the simplest interface possible. R

Hassan Shahzad 2 Jan 17, 2022
This simple python program can be used to make FontChooser dialog in Tkinter Applications.

tkFontBox This simple python program can be used to make FontChooser dialog in Tkinter Applications. how to use? Copy the tkFontBox.py file into your

Pawan Kumar Prachi 1 Feb 08, 2022
A GUI based CRUD database management system built using mysql and python

A GUI based CRUD database management system built using mysql and python

Aquila 2 Feb 13, 2022
Bank-Project - A bank ATM simulator recreated in python

Bank-Project A bank ATM simulator recreated in python. NOTE: this repo is a translation of Rasphy2009/Proyecto-Banco Requirements (.py only) 🐍 Python

Rasphy 2 Jan 02, 2022