A modern Ubuntu Touch weather dashboard built with QML + Python, powered by live weather data.
WeatherViewer is a small open-source application created to explore how a mobile-style Linux application can combine a responsive QML interface, Python business logic, and a real web API.
The user enters a city, WeatherViewer contacts the OpenWeather API, and the current weather information is presented through a clean, animated dashboard.
WeatherViewer is intentionally small, but it covers several real software-development concepts in one project:
- Building a mobile-style UI with QML
- Integrating Python with QML through PyOtherSide
- Consuming a REST API
- Parsing JSON weather responses
- Updating UI state asynchronously
- Creating reusable QML components
- Building an Ubuntu Touch application with Clickable
- Developing and testing inside a Linux virtual machine
- Managing source code and releases with Git + GitHub
Think of the architecture as:
βββββββββββββββββββββββββββββββ
β QML Interface β
β Search β’ Button β’ Cards β
ββββββββββββββββ¬βββββββββββββββ
β
β PyOtherSide
βΌ
βββββββββββββββββββββββββββββββ
β Python Backend β
β weather.py β
ββββββββββββββββ¬βββββββββββββββ
β
β HTTPS / JSON
βΌ
βββββββββββββββββββββββββββββββ
β OpenWeather API β
β Live weather data β
βββββββββββββββββββββββββββββββ
Search for a city and retrieve live:
- π‘οΈ Temperature
- βοΈ Weather condition
- π§ Humidity
The dashboard changes its weather symbol according to the returned condition:
| Condition | Display |
|---|---|
| Clear | βοΈ |
| Clouds | βοΈ |
| Rain | π§οΈ |
| Thunderstorm | βοΈ |
| Snow | βοΈ |
| Other | π |
- Centered mobile-style dashboard
- Gradient background
- Rounded weather card
- Search field
- Animated button interaction
- Loading indicator
- Reusable QML component structure
| Layer | Technology |
|---|---|
| UI | QML / QtQuick |
| Application Toolkit | Ubuntu Components |
| Backend | Python |
| QML β Python | PyOtherSide |
| Weather Data | OpenWeather API |
| Build System | CMake |
| Ubuntu Touch Packaging | Clickable |
| Development | VS Code |
| Version Control | Git + GitHub |
| Platform | Ubuntu Touch / Lomiri ecosystem |
| Development Environment | Ubuntu Linux + VirtualBox |
WeatherViewer/
β
βββ assets/
β βββ logo.svg
β
βββ qml/
β βββ Main.qml
β β
β βββ backend/
β β βββ __init__.py
β β βββ weather.py
β β
β βββ components/
β βββ WeatherCard.qml
β βββ ForecastCard.qml
β
βββ src/
β βββ example.py
β
βββ po/
β βββ CMakeLists.txt
β βββ weatherviewer2.com.amit.pot
β
βββ clickable.yaml
βββ CMakeLists.txt
βββ manifest.json.in
βββ weatherviewer2.apparmor
βββ weatherviewer2.desktop.in
βββ snapcraft.yaml
βββ LICENSE
βββ README.md
qml/Main.qml
The main application screen and QML event handling.
qml/backend/weather.py
The Python layer that calls OpenWeather and returns the weather information to QML.
qml/components/WeatherCard.qml
A reusable UI component responsible for presenting current weather information.
clickable.yaml
Clickable build configuration.
CMakeLists.txt
Defines what gets installed into the application package.
manifest.json.in
Application metadata and Ubuntu Touch package configuration.
Example:
Pune
QML calls the Python function:
weather.get_weather(city)
The backend sends an HTTPS request to the OpenWeather current-weather endpoint.
Python extracts:
temperature
humidity
weather condition
PyOtherSide passes the result back to QML.
The WeatherCard receives the new values and updates the screen.
The following workflow assumes an Ubuntu development machine or Ubuntu VM.
sudo apt update
sudo apt install git -yCheck:
git --versionsudo apt install python3 python3-pip python3-venv -yFrom your development home directory:
python3 -m venv clickable-envActivate it:
source ~/clickable-env/bin/activateYour shell should now show:
(clickable-env)
pip install clickable-utVerify:
clickable --versionFor the development environment:
sudo apt install \
qtcreator \
qtbase5-dev \
qtdeclarative5-dev \
qml-module-qtquick-controls2 \
qml-module-qtquick-layouts \
qmlscene \
qml-module-io-thp-pyotherside \
build-essential \
cmake \
git \
python3-pip \
-yPackage availability can vary between Ubuntu releases. The application itself uses Clickable/CMake packaging, while these packages provide the local development environment.
WeatherViewer uses the OpenWeather API.
Create an account and generate an API key from:
https://openweathermap.org/api
Then configure the key for your local development environment.
Never commit a real API key to GitHub.
Before publishing this repository, make sure:
- the API key is removed from source code
- the exposed key is revoked/rotated in your OpenWeather account
- only a placeholder is committed
Example:
API_KEY = "YOUR_OPENWEATHER_API_KEY"For a production-ready version, move secrets out of the source code and inject them through a secure configuration mechanism.
From the project root:
source ~/clickable-env/bin/activateThen:
clickable buildLaunch the desktop test environment:
clickable desktopThe application should open in a desktop window using the Ubuntu Touch/Lomiri-style UI.
Try several inputs.
Pune
Expected:
- temperature displayed
- condition displayed
- humidity displayed
- corresponding weather icon displayed
Mumbai
Verify the values change.
xyzabc123
The application should return an error state rather than crashing.
WeatherViewer is useful as a learning project because each part maps to a practical development concept.
Learn:
- declarative UI
- layouts
- properties
- signals
- event handling
- reusable components
- animations
Learn:
- functions
- HTTP requests
- JSON parsing
- error handling
- returning structured data
Learn:
- REST endpoints
- query parameters
- HTTP status codes
- JSON responses
- API authentication
Learn how a QML application can communicate with Python code.
Learn:
- Ubuntu Touch project structure
- application packaging
- build commands
- desktop testing
- Click packaging workflow
Learn an incremental workflow:
git status
git add .
git commit -m "Describe the change"
git pushA simple development cycle for this project is:
1. Change code
β
2. Build
β
3. Run
β
4. Test
β
5. Commit
β
6. Push
Example:
clickable build
clickable desktop
git status
git add .
git commit -m "Improve weather card layout"
git pushKeeping commits small makes it easier to understand how the application evolved.
Add screenshots of the finished application here.
Suggested files:
docs/
βββ screenshots/
βββ weather-dashboard.png
Then add:
The current release intentionally focuses on current weather rather than trying to become a full weather platform.
Implemented:
- Current weather lookup
- City search
- Temperature
- Condition
- Humidity
- Dynamic weather icon
- Loading state
- Reusable WeatherCard
- Ubuntu Touch packaging
- GitHub-based development workflow
A ForecastCard component is present in the project as groundwork for future experimentation, but forecast functionality is not part of the current release.
Activate the virtual environment:
source ~/clickable-env/bin/activateThen verify:
clickable --versionMake sure the component import exists in Main.qml:
import "components"and that the file exists:
qml/components/WeatherCard.qml
Check:
qml/backend/weather.py
and make sure the QML Python bridge loads the module from:
Qt.resolvedUrl("./backend")Check:
- Internet connection
- City spelling
- OpenWeather API key
- API key activation status
- HTTP response status
This release is deliberately small. Natural next experiments include:
- multi-day forecast
- hourly forecast
- weather history
- temperature visualization
- city comparison
- AQI integration
- location-based weather
- local favorites
- offline caching
These are intentionally outside the scope of the current release.
Contributions are welcome.
A simple contribution workflow:
git clone <repository-url>
cd WeatherViewer
git checkout -b feature/my-change
# Make your changes
git add .
git commit -m "Describe my change"
git push origin feature/my-changeThen open a pull request on GitHub.
WeatherViewer is released under the GNU General Public License v3.0 (GPL-3.0).
See LICENSE for the full license text.
Amit Awad
Built as an open-source learning project exploring:
QML + Python + APIs + Ubuntu Touch
WeatherViewer started as a small question:
βHow can a lightweight Linux mobile application turn a city name into useful information?β
The answer became a practical exercise in:
UI β Backend β API β Data β UI
That's the core lesson of this project.
Repository:
https://github.com/awadamit41/WeatherViewer
WeatherViewer v1.0.0
Built with curiosity, QML, Python, and open-source tools. π¦οΈ