An awesome application to gather data from weatherapi.com and check it with a pyqt5 GUI
Explore the code »
Report Bug
·
Request Feature
Table of Contents
I wanted to try pyQt for months but I couldn´t find an oportunity in my job. So finally I decided to give it a try!
This application is made to collect data from the WeatherAPI service and analyse it with machine learning.
It has a server made with websockets and a client made with pyqt5!
I want to experiment with different technologies and increase my coding experience. That said, If you see this and you want to help me, you are welcome!
Project is in Spanish so you may not understand all the variable names.
Main components of my application:
- A RabbitMQ server to handle data from the API using a queue + another queue to schedule tasks with celery
- A celery server that periodically computes weather forecasting using skforecast and times series data
- A reddis container that stores the serialized figures with the historical data + forecasts
- A mongoDB server where weather data is stored and also where alarms created by the user are saved
- A websockets server that handles client GUI's requests, retrieves data from the database and sends it to the pyqt5 client
- A GUI client where the final user can check the weather data, filter it, set alarms, receive notifications and more!
Here you can see how I connected all these components in a diagram:
- Get a free API Key at https://www.weatherapi.com/
- Create the
src\data_collector\server\.env
file and insert your API keyAPI_KEY = "super_secret_key"
I couldn`t create yet the deployment process for a containerized solution so, for now, I only have instructions for Windows machines.
- mongoDB
- Install mongo db on your pc
- redisContainer
docker run --name redis-server -p 6379:6379 -d redis
- RabbitMQ
- Install rabbitMq on your pc
- Python dependencies
pip install -r requirements.txt
In order to launch the application you need to do the following:
- Download the repo with
git clone https://github.com/dariofervenza/data_collector_pymongo_pyqt.git
- Launch the api_simulator with
python src\data_collector\server\api_simulator.py
- Launch the server with
python src\data_collector\server\server.py
- Launch the celery beat with:
- Navigate to the tasks.py folder with
cd src\data_collector\celery
- Launch the beat with
celery -A tasks beat --loglevel=INFO
- Navigate to the tasks.py folder with
- Launch the celery worker with:
- Navigate to the tasks.py folder with
cd src\data_collector\celery
- Launch the worker with
celery -A tasks worker -l INFO -P solo
- Navigate to the tasks.py folder with
- Launch the client with
python src\data_collector\client\client.py
Once client.py is launched, insert server address in the first form and click "Aceptar".
Insert the default user and password. You can modify it in the src\data_collector\server\config.py
file. Be aware that there is not a user creation or modification form yet.
Now you are logged in, here you can see a few images of my application, the first one is the alarm settings screen:
Visualizing weather data in a tabular style:
Checking the notifications triggered by the alarms:
- Re-do readme.md
- Create an application diagram
- Design and implement a user creation / modification window
- Add Docker implementation tutorial
- Jwt token expiration date
- Jwt token refinement
- Expiration date
- Token storage in redis
- Data anomaly detection
- New alarm types
- New data sources (MQTT)
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Darío Fervenza García - [email protected]
Project Link: https://github.com/dariofervenza/data_collector_pymongo_pyqt
Some useful resorces