Hi,
This has been a hectic ( also full of life ) summer with a lot of tasks.
Although I'd prefer working on a single task with an undeterred focus, I had no option but to multi task given the significance of the works at hand. There was no escape. Uff ! Deadlines every alternate day and that was insanely fun. However, these are unplanned, unintended and kill our productivity most of the times ( well, atleast for me ! ). I was itching myself to write a small python module for future situ like this, hence this post. To brag, this is the multitask - helping module of my favorite python based assistant, Veronica specifically for such busy days.
Basically, this is a scheduler which parses the user's Google Calendar and notifies the tasks thereby trying to co ordinate the work.
The figure below shows the simplistic overview of the steps involved.
Google has a clear python based tutorial explaining the procedure to use Calendar api. Just mentioning the steps here:
1. Create a new project on the Google Developer Console
2. Enable the Calendars API.
3. Create new client ID for standalone app and download the JSON.
Rest is a basic parser in python which extracts the time and the event from the Calendar output. The script then makes a trivial hour based comparison and notifies the user of the event. I'm using pynotify to display the message and espeak to provide speech feedback to the user.
Display Block
########################################################
def sendmessage(title, message):
pynotify.init("Test")
notice = pynotify.Notification(title, message)
notice.show()
return
This has been a hectic ( also full of life ) summer with a lot of tasks.
Although I'd prefer working on a single task with an undeterred focus, I had no option but to multi task given the significance of the works at hand. There was no escape. Uff ! Deadlines every alternate day and that was insanely fun. However, these are unplanned, unintended and kill our productivity most of the times ( well, atleast for me ! ). I was itching myself to write a small python module for future situ like this, hence this post. To brag, this is the multitask - helping module of my favorite python based assistant, Veronica specifically for such busy days.
Basically, this is a scheduler which parses the user's Google Calendar and notifies the tasks thereby trying to co ordinate the work.
The figure below shows the simplistic overview of the steps involved.
Google has a clear python based tutorial explaining the procedure to use Calendar api. Just mentioning the steps here:
1. Create a new project on the Google Developer Console
2. Enable the Calendars API.
3. Create new client ID for standalone app and download the JSON.
Rest is a basic parser in python which extracts the time and the event from the Calendar output. The script then makes a trivial hour based comparison and notifies the user of the event. I'm using pynotify to display the message and espeak to provide speech feedback to the user.
Display Block
########################################################
def sendmessage(title, message):
pynotify.init("Test")
notice = pynotify.Notification(title, message)
notice.show()
return
###############################################################
Here's a picture of the script at work.
The code is shared on github. Please feel free to play around !