Skip to content

TutorialsAndroid/weather-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌦️ Weather Widget (PyQt6)

A lightweight desktop weather widget for Windows built with Python + PyQt6.
It displays real-time weather for your city and sits neatly on your desktop like a native widget.

The widget automatically detects your location on first launch and updates the weather every 10 minutes.


✨ Features

• 🌍 Auto detect location on first launch
• 🌡️ Real-time weather updates
• 🔄 Automatic refresh every 10 minutes
• ☀️ Weather condition icons
• 🎨 Temperature color indicators
• 📌 Draggable floating desktop widget
• 🖥️ Always-on-top frameless UI
• ⚙️ System tray integration
• 🚀 Optional Start with Windows toggle
• 📍 Manual city selection
• 🔔 Weather update notifications


⬇️ Download

You can download the latest installer here:

Download Installer

After downloading:

  1. Run the installer
  2. Launch Weather Widget
  3. The widget will appear on your desktop

🖥️ How It Works

The widget:

  1. Detects your location using IP geolocation
  2. Fetches weather data from a secure serverless API
  3. Displays temperature, description, and weather icon
  4. Saves your city and widget position locally

Your settings are stored in:


LOCALAPPDATA/WeatherWidget/config.json


📦 Requirements

If running from source:


Python 3.9+
PyQt6
requests

Install dependencies:

pip install PyQt6 requests

▶️ Run From Source

Clone the repository:

git clone https://github.com/TutorialsAndroid/weather-widget.git
cd weather-widget

Run:

python weather-widget.py

Main application file:

weather-widget.py

Source code:


🏗 Build EXE

Install PyInstaller:

pip install pyinstaller

Build executable:

pyinstaller --noconfirm --onefile --windowed --icon=weather.ico weather-widget.py

The executable will appear in:

dist/weather-widget.exe

📦 Build Installer (Inno Setup)

Example script:

[Setup]
AppName=Weather Widget
AppVersion=1.0
DefaultDirName={pf}\WeatherWidget
DefaultGroupName=WeatherWidget
OutputDir=.
OutputBaseFilename=WeatherWidgetInstaller

[Files]
Source: "dist\weather-widget.exe"; DestDir: "{app}"

[Icons]
Name: "{group}\Weather Widget"; Filename: "{app}\weather-widget.exe"

Compile with Inno Setup Compiler.


⚙️ System Tray Menu

Right-click or click the ⋮ menu to access:

Refresh
Auto Detect Location
Change City
Start with Windows
Exit

🔒 Security

The OpenWeather API key is not included in this repository.

Weather requests are proxied through a serverless API to prevent key exposure.


📜 License

MIT License

Copyright (c) 2026 Akshay

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


👨‍💻 Author (Akshay - TutorialsAndroid)

Built with ❤️ using Python + PyQt6

Python Platform License

About

A lightweight **desktop weather widget for Windows** built with **Python + PyQt6**. It displays real-time weather for your city and sits neatly on your desktop like a native widget. The widget automatically detects your location on first launch and updates the weather every 10 minutes.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages