Convert your text-file birthdays into a Google Calendar, complete with annual events, notifications, handling of February 29th, zodiac signs, and more!
Google Calendar is a powerful app, but it can be difficult to get through it's complex and bulky interface. Also creating individual events can be a tedious and frustrating task.
This simple tool is created to simplify the management of birthday events in Google Calendar.
You just create a plain-text file with birthdays like that: 1990-01-31 Brave Kitty
, and birthday-reminder
creates a new calendar based on this file.
If you edit the file in the future, just run birthday-reminder
again to update the calendar and that's it!
- Install program to your computer - see Install CLI
- Windows
- click to
birthday-reminder.exe
, you should see a black text window showing up - type
validate
into this window
- click to
- MacOS / Linux
- execute
./birthday-reminder validate
in the terminal
- execute
- you should see
File ...Birthdays.txt is valid!
- Windows
- type
show next
- type
- MacOS / Linux
- run
./birthday-reminder show next
- run
- you should see one birthday record with default person:
Showing birthdays sorted by days to the next birthday:
1. 2020-01-01 - ๐ John Doe - 3 years old (Will be 4 in 169 days)
- Now open file
Birthdays.txt
and replaceJohn Doe
with your birthdays. Please follow the format described in File format - run
show next
again, to check that your data is valid- other options are
show date
andshow year
. They do the same, but with different sort order. To learn more, see Usage
- other options are
- now you are ready to upload birthdays to Google Calendar. But first, you need to authorize in Google API. Follow the steps here: Authorize in Google Calendar API
- run command
upload
inbirthday-reminder
- for the first time, you will be redirected to Google OAuth page. It opens in default browser, if you want to open it in a different browser, just copy link from the program window and paste to your browser manually.
- after authorization is done, the program will show you what changes it is going to make in your Google Calendar. To accept them, press
y
, thenEnter
- this will create new calendar
Birthday Reminder
in the Google Calendar and upload your birthday events to it
- to see your events, you can navigate to
https://calendar.google.com
. You may need to refresh the page to see changes. - Great, that's it! Now you will be notified about birthdays by Google via email and push notifications!
- To make changes to birthdays, just edit text file and then run
upload
again. - Please, do not edit events manually in Google Calendar, as it may break some logic.
- If you do change something in
Birthday Reminder
calendar, you can always delete it and then runupload
again, but please be very cautious to not to delete your own data!
- If you do change something in
- Now you can explore more calendar features. All customizations are done by editing the
main_config.yaml
file. To learn more, read Features and Advanced usage - For more information about commands, read Usage
- If you have problems with Unicode symbols, see Unicode issues
File format is very simple:
- Each line is a record with two fields:
date
andtitle
separated by whitespacedate
is in formatYYYY-MM-DD
orMM-DD
(year is optional)title
can contain any symbols except#
- text after
#
is considered a comment and is ignored - empty lines are ignored
- whitespace before and after
date
andtitle
is ignored
Example:
# this is a comment
2000-01-01 John Doe # this is also a comment
2000-01-02 Jane # leading/trailing tabs/spaces are ignored
02-03 Alex # date can be specified without year
2000-01-03 # error, title is missing
Alex # error, date is missing
Birthday reminder has pretty good default params, so you can just use it without configuration at all, but you may want to customize it.
Here I will tell you about the features and how you can configure them.
For more information, please see default_config.yaml (or main_config.yaml
, which will be created on installation)
title_prefix
andtitle postfix
- adds constant text before person's name, like "Birthday of ....", "....'s birthday", etc.use_zodiac_signs
,use_zodiac_names
- enable adding zodiac info to the event title like that: "Birthday of John Doe โ (Capricorn)"use_time
- choice between two options: full-day events (that last 00:00-23:59) and timed events - where you can chooseevent_time
andevent_duration
.- Note that time and duration are common for all events within the calendar. Individual time setting is not implemented for the sake of simplicity.
remind_29_feb_on_1_mar
- when somebody has a birthday on February 29th, there is a question - in what day to celebrate a birthday in non-leap year. Inbirthday-reminder
there are two options - to set event either on February 28th or on March 1st. Ifremind_29_feb_on_1_mar
is set tofalse
, the first option is applied. If set totrue
- the second one.popup_reminders_minutes
,email_reminders_minutes
- google can either notify you about event via popup on your phone or via email. You can set up to 5 reminder per event. Here reminder times are specified in minutes before the start of the event (negative values don't work).- You may need to use your calculator to compute the amount of minutes in day or in a week, so here are the shortcuts:
1 day = 1440 min
,1 week = 10080 min
- You may need to use your calculator to compute the amount of minutes in day or in a week, so here are the shortcuts:
Integration with Birthday Greetings AI
You can create an outstanding birthday greeting with Birthday Greetings AI
!
To do this, simply clico on birthday event in Google Calendar to open the description and follow the link provided there.
To try Birthday Greetings AI
independently, visit logosnikita.com/birthday_greetings_ai
To learn more about Birthday Greetings AI
, visit its Birthday Greetings AI @ Github
This program uses emojis, which are Unicode symbols.
If you are on Windows 10 and earlier, unicode symbols may not show correctly in the command line.
To avoid this, you can run birthday-reminder.exe
from Git Bash terminal, or just do nothing.
Regardless of command line display issues, emojis would be correctly uploaded to Google Calendar.
If you are a Windows user, also make sure that your config file and file with birthdays are in UTF-8
encoding.
If you use files provided with executable, they are fine, but if you specify your custom files, should pay attention to it.
The simplest way to create a file in the correct encoding is to copy file provided in release package and put it in the desired location.
- Navigate to Releases page
- Select distribution for your operating system and download it
- Unpack folder and put it to a place of your choice
- To run the application you need:
- on Windows - double-click on
birthday-reminder.exe
(or open a terminal and executebirthday-reminder.exe
) - on Linux / MacOS - open a terminal and execute
./birthday-reminder -h
- on Windows - double-click on
Tested on Ubuntu 22.04, but should work on Linux and MacOS.
- Put this directory to the place where all your programs live. Do not move it after installation or links will break!
- Enter the directory
cd birthday_reminder
- Run
make install_python
to setup Python3 environment. What it does:- installs packages
python3.11
andpython3.911-venv
- (if you want to use it with different version of python, you can edit
Makefile
. However, it may not work with older versions of python
- (if you want to use it with different version of python, you can edit
- creates virtual environment
venv
in directorybirthday_reminder
- installs packages
- Run
make install
to install. What it does:- creates directory
auth
with proper rights - generates files
main_config.yaml
andBirthdays.txt
- creates executable
/usr/local/bin/birthday-reminder
that runs code from the current repository
- creates directory
- Restart your shell to make autocompletion for command name work
- Run
birthday-reminder --help
If you want to contribute, you may also want to install pre-commit hook: make install_git_pre_commit_hook
Developer note:
make install
installs package in editable mode, so you can edit code andbirthday-reminder
will use the updated version
- Remove python3.11 if you do not need it (which is unlikely) -
sudo apt-get uninstall python3.11 python3.11-venv
- Run
make uninstall
- delete this repository folder
- you can modify all params in file
main_config.yaml
- File
main_config.yaml
is created during installation. It has detailed description of all params.
- File
- you can also pass these params as command line arguments. CLI arguments have higher priority than config file.
- If you want, you can specify a custom config file location with CLI argument
--config-file
- If you want, you can specify a custom config file location with CLI argument
- However, I don't recommend to use CLI arguments, because they are not as intuitive as YAML syntax.
To connect birthday-reminder
to your Google Calendar, you need to authorize in Google Calendar API.
First, you need to obtain credentials.
Here is the detailed visual guide how to do it:
- Download - super_detailed_guide_through_google_api.pdf
- Web (may not work) - super_detailed_guide_through_google_api.pdf
Here is the short text version:
- Go to the Google API Console
- Create a new project
birthday-reminder
- Enable
Google Calendar API
for the project - Go to the
Credentials
section on the left navigation bar - Click on
Configure Consent Screen
- Go through the steps to configure your consent screen
- It's important to choose
auth/calendar
scope
- Click on
Create Credentials
and selectOAuth client ID
- Select
Web application
as your Application type - Set up your
Authorized redirect URIs
. Type this string exactly:http://localhost:58585/
- Select
- You'll get a
client_id
andclient_secret
โ these are important for your project to connect to the API.- Press
Download json
and download.json
file with your credentials
- Press
- Rename downloaded file to
google_secret.json
- Put it to the directory
auth
in the root of the project.
- You can add birthdays to the
Birthdays.txt
file, which is created during installation.- You can specify a custom file location by editing parameter
input_file
inmain_config.yaml
- You can specify a custom file location by editing parameter
- To check if file is valid, run
birthday-reminder validate
- To show birthdays from file, run
birthday-reminder show next
- this will show birthdays sorted by number of days to the next birthday.- The other sort options are:
show date
- sorted by month and dayshow year
- sorted by year of birth (dates without known year will show up in the end)
- The other sort options are:
- To show birthdays from Google Calendar, run
birthday-reminder gshow next
.- To run this command, you first need to authorize in Google Calendar. (See the previous section for details)
- If you haven't run
upload
yet, there will be no birthdays in Google Calendar, so you'll see an empty list.
- To show diff between file and Google Calendar, run
birthday-reminder diff
- To upload birthdays from file to Google Calendar, run
birthday-reminder upload
- This command first will show
diff
between file and Google Calendar, explain what changes it's going to make and ask for confirmation - Upload supports optional flags:
-y
/--yes
- do not ask for confirmation-f
/--force
- delete all events in Google Calendar and upload all events from file
- This command first will show
Note:
birthday-reminder
will create a new calendar in your Google Calendar calledBirthday Reminder
(you can change this name inmain_config.yaml
).- It will not modify any events from other calendars.
- Calendar created by
birthday-reminder
is not intended to be edited manually from Google Calendar web interface.- The only things you can do in web interface are
- change the color of the calendar (unfortunately, it's not possible to change the color via API).
- set the default calendar time zone. (also does't work through API). It is useful if you choose full-day events option (
use_time: false
), because full-day events follow the calendar time zone. Timed events, however, follow the time zone of the event itself, which is effectively set by thebirthday-reminder
program.- If you want to edit events, you should edit
Birthdays.txt
file and runbirthday-reminder upload
again.
- If you want, you can create several birthday calendars with different preferences. For example, one for friends and one for colleagues.
- To do this, you need to create two separate config files, then configure each calendar accordingly.
birthday-reminder
distinguishes calendars by their names, so just set different values incalendar_name
field.- Be careful and do not set the same name as your existing calendar, otherwise
birthday-reminder
can potentially delete all events from it! - However, it will ask for confirmation before doing this (if
--force
parameter is not specified).
- Be careful and do not set the same name as your existing calendar, otherwise
- also set fields
input_file
in both config to point to corresponding text files with your birthdays data - After that, you can run
birthday-reminder <command>
with--config-file
(or simply-c
) parameter to specify which config file to use.