Simple yet elegant weather application
- adaptable color scheme to time of the day and weather conditions;
- ability to select a weather api;
- selectable temperature units and time formats;
- simple yet effective location search;
- location autosetting;
- written in kivy and tkinter GUI frameworks.
Weather app uses kivy as a frontend framework and can be installed on both mobile and desktop platforms. Installation process:
git clone https://github.com/Denis-Source/weather_app
cd weather_app
It is recommended to use venv Windows:
python -m venv venv
venv\Scripts\Activate.ps1
pip install -r requirements.txt
Linux/MacOS:
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
In order to use the app you should have API keys. For testing purposes, you can use MetaWeather and Sunset and Sunrise APIs. To run the app simply start the main file:
python weather_app.py
By default, the app will ask a location to get weather about. The location can be entered in any language supported by the APIs. The search screen can be omitted if the default location setting is set.
Location is determined by the API and it has a comprehensive list of cities and locations all around the world.
When the location is entered, the application makes several calls to the APIs:
- depending on whether the selected API gets the coordinates or the woeid of the specified location;
- gets information about sun rise or set timings (needed to determine time of the day of the location);
- api call to get current weather information;
- one or several calls to get a forecast for the next 4 or more days.
If the entered city is correct and the API key is correct, the API returns a valid response.
The list of API handlers that parse and decode the information to a standard format, creating a weather object that contains the following information:
- current temperature;
- current weather conditions;
- approximate daily forecast for the next 4 days;
- other information is stored but not used (wind, humidity, etc).
The main design feature of the application is the ability to change its appearance depending on weather conditions and time of the day.
The application allows you to change time format, temperature units as well as APIs you call. All this work can be done via the configuration screen (menu button or f1
key).
The screen theme is also dynamically changed.
There is an option to define the default location.
The application has 3 or 4 different types of APIs:
- geolocation;
- sunrise and sunset information about the location;
- current weather information;
- average forecast for the following 4 or more days.
The architecture of the app allows dynamic selection of APIs on the fly.
As the latest version is considered, there are the following available APIs:
- OpenWeather: geolocation, weather and sun information;
- AccuWeather: geolocation and weather;
- MetaWeather: geolocation and weather;
- Sunset and Sunrise: sun information.
Some of them require an API key and allow a limited daily requests amount; others are free.
Note: Some APIs use woeid and other longitude and latitude, so as a consequence they, are not compatible.