Skip to content

dariofervenza/data_collector_pymongo_pyqt

Repository files navigation

MIT License LinkedIn


Logo

Weather data collector client-server application

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
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

Product Name Screen Shot

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:

Product Name Screen Shot

(back to top)

Built With

  • Python
  • PyQt
  • WebSockets
  • RabbitMQ
  • Celery
  • Matplotlib
  • Skforecast
  • Redis

(back to top)

Getting Started

  1. Get a free API Key at https://www.weatherapi.com/
  2. Create the src\data_collector\server\.env file and insert your API key
    API_KEY = "super_secret_key"

Prerequisites

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

Installation

In order to launch the application you need to do the following:

  1. Download the repo with git clone https://github.com/dariofervenza/data_collector_pymongo_pyqt.git
  2. Launch the api_simulator with python src\data_collector\server\api_simulator.py
  3. Launch the server with python src\data_collector\server\server.py
  4. Launch the celery beat with:
    1. Navigate to the tasks.py folder with cd src\data_collector\celery
    2. Launch the beat with celery -A tasks beat --loglevel=INFO
  5. Launch the celery worker with:
    1. Navigate to the tasks.py folder with cd src\data_collector\celery
    2. Launch the worker with celery -A tasks worker -l INFO -P solo
  6. Launch the client with python src\data_collector\client\client.py

(back to top)

Usage

Once client.py is launched, insert server address in the first form and click "Aceptar". Server form

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.
User form

Now you are logged in, here you can see a few images of my application, the first one is the alarm settings screen:
Alarms configuration

Visualizing weather data in a tabular style:
Weather data

Checking the notifications triggered by the alarms: Alarm notifications

Forecasting: Backtest

(back to top)

Roadmap

  • 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)

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Darío Fervenza García - [email protected]

Project Link: https://github.com/dariofervenza/data_collector_pymongo_pyqt

(back to top)

Acknowledgments

Some useful resorces

(back to top)

About

Client server app used to store data from an API and analyse it with machine learning.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages