This repository combines the power of Artificial Intelligence (AI) and GitHub Actions to automatically gather, analyze, and predict weather data. The project is designed to be fully automated, leveraging GitHub Actions for continuous data collection and model training, all within a structured and organized workflow.
The goal of this project is to automate the process of obtaining weather data, analyzing it, and making accurate weather forecasts using AI. The system is designed to collect weather data periodically, store it in a separate branch (data), and use this data to train an AI model that predicts future weather conditions.
- Automated Data Collection: A GitHub Action periodically collects weather data from the wttr.in api and stores it in the
data
branch of this repository.v - AI-based Weather Forecasting: The collected data is used to train a machine learning model, which predicts future weather conditions.
- Organized Data Management: The
main
branch contains the core code, while thedata
branch stores all the weather data, keeping the repository clean and efficient. - Customizable Workflow: The project is designed to be flexible and easily customizable to suit different weather APIs, data analysis methods, and machine learning models.
-
Data Collection: The
action.yml
is triggered every one hour. It performs the following steps:- Checks out the main branch to run the Python script for collecting weather data.
- Checks out the data branch to store the collected data.
- Commits and pushes the new data to the data branch.
-
Data Analysis and Forecasting:
still in development...
- Garbage Collector: A procedure for evaluating data after it has been collected, to avoid data duplications
- main: Contains the core Python scripts and configuration files for data collection and model training.
- data: Stores all the weather data collected by the GitHub Actions. This branch is automatically updated with new data but is kept separate from the main codebase to maintain efficiency.
├───.github/
│ └──workflows/
│ └───collect_weather_data.yml # GitHub Action for data collection and for data analyzing
├───config # Where all configuration files are saved
├───models # Folder where all the pre-trained models are present
│ ├───best-models
│ ├───sklearn-models
│ └───torch-models
├───src # Folder where all the source code is present
│ ├───actions # Folder containing the scripts for the various GitHub Actions
│ └───models # Folder containing scripts for creating separate models for each library
│ └───utils # Folder containing a set of scripts used for general utilities
├───action-requirements.txt # Requirements to launch GitHub Actions
├───action.yml
└───README.md # This file : )
├── collected/ # The folder containing all the data collected up to now, saved in folders, and divided by city
│ ├── YYYY--MM-DD_hh-mm-ss/
│ | ├── New York.json # An example file containing data in json format
│ | ...
│ ...
- Python 3.9 or later
-
Clone the repository:
git clone GitGinocchio/weather-prediction-with-github-actions.git cd weather-prediction-with-github-actions
-
Install dependencies:
pip install -r action-requirements.txt pip install -r dev-requirements.txt
to run the data collection script locally:
python src/actions/collect_weather_data.py
All weather data is stored in the data branch of this repository. You can switch to this branch to view or download the data:
git checkout data
Contributions are welcome! If you'd like to contribute, please fork the repository and submit a pull request.
This project is licensed under the MIT License. See LICENSE for details.