Adapted from QuixSens/gmail-event-extractor
Event Grabber allows you to fetch and extract key events and dates from your Gmail and automatically add them to your Google Calendar.
This version has been customized for my personal workflow, with a few tweaks, I am hoping to use this for my own Alexa variation I am building currently as well as a smart mirror.
- Python 3.8 or higher
- Gmail account with IMAP enabled
- Download and install Ollama
- Google Calendar API credentials (JSON file from Google Cloud Console)
- Required Python packages:
- google-auth
- google-api-python-client
- google-auth-httplib2
- google-auth-oauthlib
- imaplib (standard library)
- email (standard library)
- (and any other dependencies as needed)
Clone this repository:
git clone https://github.com/brantcass/Event-grabber.git
cd Event-grabber
Install required Python packages:
pip install -r requirements.txt
(If you donβt have a requirements.txt yet, create one with the needed packages)
Set up your Google Calendar API credentials:
- Follow the Google Calendar API Python Quickstart to create
credentials.json - Save
credentials.jsonin the project root folder
Enable IMAP in your Gmail account:
- Go to Gmail Settings β Forwarding and POP/IMAP β Enable IMAP
Configure your script if needed:
- Adjust any config variables (email address, labels, date ranges, etc.) inside the Python script.
Run the script:
python main.py
Authorize access to your Google Calendar:
- On first run, a browser window will open to authorize the app to access your calendar.
Enjoy your events automatically added to your Google Calendar!
- Make sure your Gmail account has emails with calendar event details for the script to extract.
- The script parses dates and events based on heuristics β it might need tweaking for specific email formats.
- Keep your credentials secure and donβt share them publicly.