0
votes

There was a previous question about this (Google Calendar API Event Free/Busy/Blocking Data) asking "...how to tell if an event a calendar should be considered an event that blocks time." I have the same question. The answer posted to the previous question was to use the transparency field (opaque vs. transparent) to tell whether the event was blocking or not. Using Python to call for events, my event results don't include the transparency field. Here is a snippet of my code:

  eventsResult = service.events().list(
    calendarId=calID, timeMin=now, timeMax=stop_datetime, singleEvents=True,
    orderBy='startTime').execute()
  events = eventsResult.get('items', [])

  for event in events: 
    print ('\n'.join(event))
    print ('\n')

Here are the results:

status
kind
end
description
created
iCalUID
reminders
htmlLink
sequence
updated
summary
start
etag
location
organizer
creator
id
hangoutLink

My question is: how can I tell if an event is blocking or not? If using the transparency field is the solution, how can I get it to show up in my results?

1

1 Answers

1
votes

It looks like that the transparency field only appears on all-day events and only when it's set to "transparent". I used the following criteria to find all-day events that are marked as "busy".

for event in events:
  if 'transparency' not in event and not event['start'].get('dateTime'):