Skip to content

Moodle-Mate is a Python program designed to fetch Moodle notifications at regular intervals (60 seconds), summarize their content using GPT-3/4, and send it summarized as a notifications via Pushbullet to your smartphone or webhook to Discord.

License

Notifications You must be signed in to change notification settings

EvickaStudio/Moodle-Mate

Repository files navigation

Moodle Mate

Your Smart Moodle Notification Assistant


GitHub Workflow Status GitHub license GitHub issues GitHub pull requests GitHub last commit GitHub Watchers GitHub Repo Stars GitHub repo size

Note

The codebase is currently under refinement for enhanced modularity and maintainability. For the latest version, please visit the dev branch.


Table of Contents


Overview


Moodle Mate automatically retrieves your Moodle notifications and intelligently summarizes them, giving you a quick and clear overview of what's important. It delivers these summaries straight to your preferred channels like Discord, Pushbullet, and more. Designed for seamless integration into server environments, Moodle Mate offers high flexibility with adjustable update intervals tailored to meet your needs.

Key Features:

  • Cost-effective operation with GPT-3.5-turbo, minimizing expenses. (typically less than $0.15 per month, excluding server expenses). Alternatively you could just disable summarization in the config file

  • Optional OpenAI Assistant integration for intelligent, context-aware responses, currently available in German. To use the Assistant, set the test variable in summarizer.summarize to True:

    Example:

    # utils > main_loop.py > main_loop()
    
    # line 56, works [08.01.2024]
    summary = summarizer.summarize(text, True)
  • Supports popular platforms including Pushbullet, Discord, and NTFY (BETA) for versatile notification delivery.

  • Offers flexible scheduling for periodic background execution and incorporates error handling mechanisms.

  • Uses "only" 50MB of RAM 99% of the time, making it lightweight and cost-effective. (Tested on a Raspberry Pi Zero 2 W)

NEW: Integration of Deepinfras API with support for dolphin-2.6-mixtral-8x7b (cheap alternative to gpt 3) NEW: Experimentation with fakeopen, a free API for GPT-4-32k chat completions. (Usage discretion advised due to potential inconsistencies.)

Dependencies


Moodle Mate depends on several specialized API wrappers and libraries:

  • MoodleAPI: A custom interface for Moodle API interactions.
  • OpenAI: Integration with OpenAI's API.
  • Pushbullet: Connectivity with Pushbullet API.
  • NTFY: Connectivity with NTFY API.
  • Discord: Implementation using Discord webhooks.

To ensure smooth operation of Moodle Mate, ensure Python 3.10 or higher is installed.

  • Python >= 3.10: Necessary for compatibility and functionality.

Installation


If you prefer to work within a virtual environment, please follow the instructions provided in the Optional Virtual Environment Setup guide. This way you can avoid potential conflicts with other Python projects and ensure a clean installation. Otherwise, you may skip this step and install Moodle Mate directly into your system.

To install Moodle Mate, follow these steps:

  1. Clone the repository and access the main directory:
    git clone https://github.com/EvickaStudio/Moodle-Mate.git
    cd Moodle-Mate
  2. Install necessary Python dependencies from the requirements.txt file:
    pip install -r requirements.txt

Configuration


Configuration of Moodle Mate requires setting up a config.ini file. Key parameters include Moodle URL, account credentials, and various API keys for functionality and integrations.

Parameter Description Required Default
moodleUrl Moodle URL for API access Yes N/A
username Moodle Account Username Yes N/A
password Moodle Account Password Yes N/A
openaikey OpenAI API Key No N/A
pushbulletkey Pushbullet API Key No N/A
pushbulletState Pushbullet State (ON = 1 else 0) No 0
webhookState Webhook State (ON = 1 else 0) No 0
webhookUrl Discord Webhook URL Yes N/A
systemMessage System Message for GPTs Yes default config
model GPT Model (recommend: gpt-4-1106-preview) No gpt-3.5-turbo-1106
fakeopen Implementation of fakeopen API Yes 0
summary Use GPT for summary (ON = 1 else 0) Yes 0

A detailed example configuration is available here.

Usage


With the configuration complete, execute the main script to start the application:

Tip

Moodle Mate processes only new notifications, current last notification will not be send.

python3 main.py

Documentation


Comprehensive documentation, detailing functionalities and operational guidelines, is organized by module within each directory.

Screenshots


Screenshots of the application in action:

Main Program Interface

Main Program

Discord Webhook Integration (Old)

Discord Screenshot (old)

Discord Webhook Integration (New)

Discord Screenshot

Contributing


We'd love your help making Moodle Mate even better! Contribute by:

  • Reporting bugs
  • Suggesting new features
  • Submitting pull requests

Status

Alt

Author


Moodle Mate is created with ❤️ by EvickaStudio.

License


This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details.

About

Moodle-Mate is a Python program designed to fetch Moodle notifications at regular intervals (60 seconds), summarize their content using GPT-3/4, and send it summarized as a notifications via Pushbullet to your smartphone or webhook to Discord.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published