Birthday reminder (annims.py)

Birthday reminder (annims)

I spent the evening writing this program in Python to remind me about upcoming birthdays.

I know these days most people will probably just rely their smartphones’ calendar app. But I kept missing their damn notifications about upcoming birthdays. Either I don’t open the calendar often enough or the notification doesn’t seem to show up (or it does but only on the birthday, so it’s already too late).

So I wanted to have a program that could parse a simple text file with birthdates, check if the birthday is within a certain time frame and if so send an email to my email address.

Sending emails is a pretty straightforward process in Python. I am using smtplib for that.

You can set the time interval you want

I’ve set the time interval by default to 5 days, so it does give me some leeway. But I wrote this in a way you can define it any way you want. Another good timeframe would be to set it to 31 days, to get monthly reminders.

anacrontab

I recommend using this script in combination with anacron which has the huge advantage on every day computer systems that it will check if the script has already been executed in the specified time frame and will execute it exactly as specified even when your system is not up and running all the time.

On Ubuntu distributions any script you link in /etc/cron.daily (or hourly, monthly, etc.) is automatically managed by anacron, so there is no hassle for you there.

My installation instructions

git clone https://github.com/yabbes/annims.py ~/.annims.py
sudo ln -s ~/.annims.py/annims.py /etc/cron.weekly/annims.py 

Then proceed to modify the variables in settings.py and fill in your GMail account and recipient email address in account_info.py

Last but not least fill in some birthdays you don’t want to forget about in bdaylist.txt one per line - Add birthday dates either in DD-MM-YYYY or just DD-MM format - Use “:” as a delimiter between date and name

Link to the repository on Github