Code Monkey home page Code Monkey logo

jai0401 / hackai_hack-230679 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 44.74 MB

The Temperature Alert Agent is a Python script that utilizes the uAgents library to monitor real-time temperatures from the OpenWeatherMap API. Users can set a preferred temperature range for a specific location, and the script will alert them if the temperature goes beyond this range.

Python 97.85% PowerShell 0.03% Shell 0.03% Cython 0.14% C 0.21% HTML 0.46% JavaScript 1.23% CSS 0.04% Batchfile 0.01% Nushell 0.01%
fetch-ai fetchai python temperature-monitoring uagents weather-api

hackai_hack-230679's Introduction

Temperature Alert Agent

Description

The Temperature Alert Agent is a Python script that uses the uAgents library to fetch real-time temperatures from a free weather API for a specified location. It allows users to set their preferred temperature range (minimum and maximum temperature) and sends an alert/notification when the current temperature in the chosen location goes below the minimum or above the maximum threshold.

Instructions to Run

To run the Temperature Alert Agent, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/yourusername/temperature-alert-agent.git
    
    
  2. Navigate to the project directory:

    cd HackAI_Hack-23067
    cd src
    cd uagents
  3. Install the required dependencies using Poetry:

    poetry install
  4. Set your OpenWeatherMap API key and preferred location in the hackathon.py script:

    api_key = "Your_OpenWeatherMap_API_Key"
    location = "Your_Location"  # e.g., "London, UK"
    min_temperature = 20  # Minimum preferred temperature in °C
    max_temperature = 30  # Maximum preferred temperature in °C
  5. Run the Temperature Alert Agent:

    python hackathon.py

The agent will start fetching the current temperature for the specified location and send alerts if the temperature goes outside the preferred range.

Special Considerations

  • Make sure you have a valid OpenWeatherMap API key. You can obtain one by signing up on the OpenWeatherMap website.
  • The agent fetches temperature data every 30 minutes by default. You can adjust the update interval by changing the period parameter in the check_temperature method in the hackathon.py script.
  • Ensure that your environment allows outbound internet connections for API requests.

Feel free to reach out for any questions or assistance with running the Temperature Alert Agent.

hackai_hack-230679's People

Contributors

jai0401 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.