A simple script to send alerts/reminders for caldav events.
Go to file
Sam 8fe759673d Update Makefile, README and service file for remindme_caldav
- The Makefile now includes installation instructions for Debian/Ubuntu based systems.
- The README has been updated with more detailed descriptions of the script's purpose, how it works, and how to use it.
- The service file has been added to manage the remindme_caldav daemon on a systemd-based system.
2024-02-15 15:21:37 +00:00
.gitignore track .gitignore 2024-02-08 15:41:09 +00:00
LICENSE Initial commit 2024-02-04 03:01:11 +00:00
Makefile Update Makefile, README and service file for remindme_caldav 2024-02-15 15:21:37 +00:00
README.md Update Makefile, README and service file for remindme_caldav 2024-02-15 15:21:37 +00:00
alert_processor.py Refactor code to combine email and XMPP alerting into single class 2024-02-12 02:19:49 +00:00
config.toml alerting and filehandling 2024-02-06 19:02:44 +00:00
remindme_caldav.py Update Makefile, README and service file for remindme_caldav 2024-02-15 15:21:37 +00:00
remindme_caldav.service Update Makefile, README and service file for remindme_caldav 2024-02-15 15:21:37 +00:00
requirements.txt Update dependencies 2024-02-12 02:30:50 +00:00

README.md

remindme_caldav

A Calendar Alerting Daemon

Purpose

This script is a simple calendar alerting daemon written in Python. It monitors .ics files for changes and sends alerts based on the events' start times, recurrence rules, and alert triggers defined within these files. The main purpose of this script is to provide reminders or notifications about upcoming events.

How it Works

The script works by parsing .ics files using the icalendar library, which converts them into a Python dictionary format for easier manipulation. It then processes each event and calculates when the next alert should be triggered based on the event's start time, recurrence rules, and alert triggers. If an alert is due to trigger, it sends a notification via email or XMPP (an instant messaging protocol).

The script also monitors for changes in the directory containing .ics files using the watchdog library. When a file is modified, created, or deleted, it updates its internal list of events accordingly.

How to Use It

This script should be used with a calendar syncing service such as vdirsyncer. vdirsyncer can be scheduled using cron to sync regularly from the CalDav server.

To use this script, you need Python 3 installed on your system. You can install the required libraries by running:

pip install -r requirements.txt

You also need a .toml configuration file with the following structure:

[app]
calendar_dir = "/path/to/your/ics/files"
email_address = "your-email@example.com"
smtp_server = "smtp.example.com"
smtp_port = 587
smtp_username = "your-username"
smtp_password = "your-password"
...

You can then run the script with:

python3 remindme_caldav.py --config /path/to/your/config.toml

Installation

A Makefile and systemd service file is also included for Debian/Ubuntu based systems.

This Makefile does the following:

  • install: Installs Python 3.11, creates a virtual environment in /opt/remindme_caldav/.venv, installs dependencies from requirements.txt into this virtual environment, copies your script to /opt/remindme_caldav/, and sets up the systemd service file.

  • uninstall: Stops and disables the systemd service, removes the installation directory (/opt/remindme_caldav/), and deletes the systemd service file.

  • clean: Deactivates the virtual environment.