https://github.com/sentinelbyte/weatherforcastmas
Multi-Agent-System that fetches real-time weather data, generates activity suggestions, and organizes a 7-day forecast.
https://github.com/sentinelbyte/weatherforcastmas
Last synced: 4 months ago
JSON representation
Multi-Agent-System that fetches real-time weather data, generates activity suggestions, and organizes a 7-day forecast.
- Host: GitHub
- URL: https://github.com/sentinelbyte/weatherforcastmas
- Owner: SentinelByte
- License: mit
- Created: 2025-09-06T11:30:14.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-15T13:37:55.000Z (9 months ago)
- Last Synced: 2025-09-15T14:46:14.780Z (9 months ago)
- Language: Python
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WeatherForecastMAS π¦οΈ
WeatherForecastMAS is a **Multi-Agent System (MAS)** that fetches live weather data, plans daily activities, and maintains a 7-day forecast.
It is designed for learning MAS concepts and for practical use as a personal weather + activity assistant.
---
`Owner: DanCohVax`
## π Features
- **Daily Weather Plan** β Fetches todayβs conditions & suggests a randomized activity.
- **Weekly Forecast** β Stores 7-day weather outlook.
- **Automatic Updates** β Refreshes forecast every 6 hours via UpdateAgent.
- **Dashboard** β View data in a Streamlit-powered local web app.
- **Event-Driven MAS** β Agents communicate via a simple Pub/Sub EventBus.
- **History Tracking** β Maintains daily weather and activity history with timestamps.
- **Lightweight & Free** β Uses free-tier weather APIs.
---
## π Project Structure
```
weather\_mas/
β
βββ agents/ # all agents live here
β βββ weather\_agent.py # fetch todayβs weather, update history, publish event
β βββ planner\_agent.py # suggest activities, update history, subscribe to weather events
β βββ forecast\_agent.py # fetch 7-day forecast, update history
β βββ update\_agent.py # refresh forecast & notify planner periodically
β βββ display\_agent.py # output via console or Streamlit dashboard
β
βββ data/ # storage for JSON / DB
β βββ today.json # latest weather
β βββ forecast.json # 7-day forecast
β βββ history/ # historical records
β βββ weather\_history.json # daily weather records with timestamps
β βββ activity\_history.json # daily activity suggestions with timestamps
β
βββ dashboard/ # Streamlit dashboard files
β βββ app.py
β
βββ utils/ # helpers (logging, API calls, config)
β βββ api\_client.py
β βββ config.py # API keys, city, units
β βββ event\_bus.py # simple Pub/Sub EventBus implementation
β
βββ main.py # entry point β runs daily workflow using agents
βββ main\_event\_mas.py # optional: MAS workflow with EventBus and dashboard
βββ update.py # entry point β runs every 6h (Update Agent)
βββ requirements.txt # dependencies: requests, streamlit, etc.
βββ README.md
````
---
## βοΈ Configuration
Create a `utils/config.py` file with your weather API key:
```python
API_KEY = "your_weather_api_key"
CITY = "Berlin"
UNITS = "metric" # "imperial" for Fahrenheit
````
You can use [WeatherStack](https://weatherstack.com/) or another free API.
> β οΈ Do **not** commit `config.py` to GitHub. Use `config.example.py` instead.
---
## π οΈ Installation
1. Clone the repo:
```bash
git clone https://github.com/SentinelByte/WeatherForcastMAS.git
cd WeatherForecastMAS
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
---
## βΆοΈ Usage
### Run Daily Workflow (fetch todayβs weather + weekly forecast)
```bash
python main.py
```
### Run EventBus MAS (optional, with dashboard & inter-agent events)
```bash
python main_event_mas.py
```
### Run Forecast Updater (every 6h, via cron/Task Scheduler)
```bash
python update.py
```
### Run Dashboard (local visualization)
```bash
streamlit run dashboard/app.py
```
---
## π
Automation
Use cron (Linux/macOS) or Task Scheduler (Windows) to automate:
```bash
# Run daily plan at 7 AM
0 7 * * * /usr/bin/python3 /path/to/weather_mas/main.py
# Run forecast updater every 6 hours
0 */6 * * * /usr/bin/python3 /path/to/weather_mas/update.py
```
---
## π Roadmap
* [ ] Add support for multiple cities
* [ ] Store historical weather in SQLite
* [ ] Email/Telegram notifications
* [ ] Grafana/Streamlit advanced dashboard
* [ ] Add AI-powered activity recommendations
---
## π License
MIT License β feel free to use and modify.