Skip to content

A Python-based tool that sends automated email alerts for disasters using real-time data. Integrates APIs to monitor disaster events and notifies users efficiently, ensuring timely updates and improved preparedness.

License

Notifications You must be signed in to change notification settings

aloukikjoshi/DisasterAlertMailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌪️ DisasterAlertMailer 📧

DisasterAlertMailer is a Python-based application that tracks weather alerts and sends emergency notifications via email. It uses the WeatherAPI to fetch weather alerts and the Gmail API to send emails. The device's location is determined using the ipinfo.io service.

📋 Table of Contents

  • Features
  • Installation
  • Configuration
  • Usage
  • Contributing
  • License

✨ Features

  • 🌍 Location Tracking: Automatically tracks the device's location using ipinfo.io.
  • 🌦️ Disaster Alerts: Fetches alerts from WeatherAPI.
  • 📧 Email Notifications: Sends emergency alerts via Gmail.
  • Scheduler: Checks for disasters every 15 minutes (adjustable).

🛠️ Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/DisasterAlertMailer.git
    cd DisasterAlertMailer
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt
  4. Set up environment variables: Create a .env file in the root directory and add the following:

    FROM_EMAIL=your-email@gmail.com
    TO_EMAIL=recipient-email@gmail.com
    WEATHERAPI_KEY=your-weatherapi-key
    CLIENT_SECRET_FILE=client_secret.json
  5. Add your Google OAuth2 credentials: Download your client_secret.json from the Google Cloud Console and place it in the root directory.

⚙️ Configuration

  • FROM_EMAIL: The email address from which alerts will be sent.
  • TO_EMAIL: The recipient email address for alerts.
  • WEATHERAPI_KEY: Your API key for WeatherAPI.
  • CLIENT_SECRET_FILE: The path to your Google OAuth2 client secret file.

🚀 Usage

  1. Run the application:

    python dm.py
  2. The application will start and check for weather alerts every 15 minutes. If an alert is found, an email will be sent to the specified recipient.

🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add some feature').
  5. Push to the branch (git push origin feature-branch).
  6. Open a pull request.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.


Made with ❤️ by Aloukik Joshi

About

A Python-based tool that sends automated email alerts for disasters using real-time data. Integrates APIs to monitor disaster events and notifies users efficiently, ensuring timely updates and improved preparedness.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages