A Python GUI weather station for a Raspberry Pi touchscreen. The active app is IMS-only: it reads current local observations from the Israel Meteorological Service last-hour XML feed and Hadera forecasts from the IMS city portal:
https://ims.gov.il/en/city_portal/18
- Current time and date.
- Current temperature and humidity from the configured IMS station.
- Three-day forecast for Hadera from the IMS city portal.
- Weather icons mapped from IMS condition text to the local icon set.
- Network/API status indicators.
- Raspberry Pi OS or another Linux desktop environment.
- Python 3.10+.
- Internet connection for live IMS data.
- Python dependencies from
requirements-lock.txt.
Install dependencies:
python3 -m venv weather_venv
source weather_venv/bin/activate
python -m pip install -r requirements-lock.txtrequirements-lock.txt pins the tested runtime environment for Raspberry Pi
reinstalls. Use requirements.txt when intentionally updating dependencies.
Use the repository virtual environment for local checks:
./weather_venv/bin/python -m pip install -r requirements-dev.txt
./weather_venv/bin/python -m pytest
./weather_venv/bin/python -m ruff check .
./weather_venv/bin/python -m mypy weather_displayGitHub Actions runs the checks on Python 3.10 and 3.11, smoke-tests the GUI
under Xvfb, and builds the package on pushes to main and pull requests.
Dependabot is configured for Python dependencies and GitHub Actions.
For repository security, the checked-in workflows run CodeQL, dependency review, and Gitleaks secret scanning. Also enable GitHub's native secret scanning and Dependabot alerts in the repository security settings when available.
Edit weather_display/config.py:
IMS_STATION_NAME: station for current observations. Current value:"En Hahoresh".IMS_CITY_LOCATION_ID: IMS city portal id for the forecast. Hadera is18.LANGUAGE: display language, currently"en"or"ru".IMS_UPDATE_INTERVAL_MINUTES: refresh interval for current observations.IMS_FORECAST_UPDATE_INTERVAL_MINUTES: refresh interval for forecast data.FULLSCREEN: fullscreen kiosk mode.USE_MOCK_DATA: run without live IMS calls for testing.
From the project root:
source weather_venv/bin/activate
python run_weather_display.pyUseful options:
python run_weather_display.py --windowed
python run_weather_display.py --mock
python run_weather_display.py --headlessThe GUI app is started by the Raspberry Pi desktop session, not by systemd.
This is intentional. Tk/CustomTkinter needs the logged-in desktop display
environment, and a system service does not reliably inherit DISPLAY,
XAUTHORITY, or the user session runtime.
Use this desktop autostart hook as the source of truth:
/home/alex/.config/autostart/weather-display.desktop.
Do not enable or rely on weather-display.service for GUI launch. If that
service exists on the machine, leave it disabled; it is not the active startup
strategy for this project.
Create or update ~/.config/autostart/weather-display.desktop:
[Desktop Entry]
Type=Application
Name=Weather Display
Exec=/home/alex/weather_claude/weather_venv/bin/python /home/alex/weather_claude/run_weather_display.py
Path=/home/alex/weather_claude
Terminal=false
StartupNotify=falseNo API key is needed.
If the app is already running, stop the current Python process and relaunch it inside the active desktop session. On this Raspberry Pi, the working manual launch command is:
env DISPLAY=:0 \
XAUTHORITY=/home/alex/.Xauthority \
XDG_RUNTIME_DIR=/run/user/1000 \
/home/alex/weather_claude/weather_venv/bin/python \
/home/alex/weather_claude/run_weather_display.pyDo not use systemctl start weather-display.service to preview GUI changes.
- Check
~/.local/state/weather_display/weather_display.logfor startup and data-fetch errors. - If the GUI fails, confirm the Pi booted into a desktop session and
DISPLAYis set. - If current observations are missing, verify
IMS_STATION_NAMEmatches a station in the IMS last-hour XML feed. - If forecasts are missing, verify
IMS_CITY_LOCATION_ID = 18for Hadera or open the IMS city portal URL in a browser.