def __create_service():
    with open('credentials', 'rw') as f:
        credentials = Credentials.new_from_json(f.read())
http = httplib2.Http()
http = credentials.authorize(http)
return build('calendar', 'v3', http=http)
Google Calendar API - Access own calendar via Service account