planer/experimenting/quickstart.py
def main():
    """Shows basic usage of the Google Calendar API.

    Creates a Google Calendar API service object and outputs a list of the next
    10 events on the user's calendar.
    """
    credentials = get_credentials()
    service = build('calendar', 'v3', http=credentials.authorize(Http()))

    now = datetime.utcnow().isoformat() + 'Z' # 'Z' indicates UTC time
    print('Getting the upcoming 10 events')
    eventsResult = service.events().list(
        calendarId='primary', timeMin=now, maxResults=10, singleEvents=False,
        orderBy='startTime').execute()
    events = eventsResult.get('items', [])

    if not events:
        print('No upcoming events found.')
    for event in events:
        pprint(event)
        #start = event['start'].get('dateTime', event['start'].get('date'))
        #print(start, event['summary'])
Shows basic usage of the Google Calendar API.

    Creates a Google Calendar API service object and outputs a list of the next
    10 events on the user's calendar.
    
Shows basic usage of the Google Calendar API.
Creates a Google Calendar API service object and outputs a list of the next
10 events on the user's calendar.
Shows basic usage of the Google Calendar API . Creates a Google Calendar API service object and outputs a list of the next 10 events on the user ' s calendar .
def main():
    credentials = get_credentials()
    service = build('calendar', 'v3', http=credentials.authorize(Http()))
    now = datetime.utcnow().isoformat() + 'Z' 
    print('Getting the upcoming 10 events')
    eventsResult = service.events().list(
        calendarId='primary', timeMin=now, maxResults=10, singleEvents=False,
        orderBy='startTime').execute()
    events = eventsResult.get('items', [])
    if not events:
        print('No upcoming events found.')
    for event in events:
        pprint(event)
def main ( ) : credentials = get_credentials ( ) service = build ( 'calendar' , 'v3' , http = credentials . authorize ( Http ( ) ) ) now = datetime . utcnow ( ) . isoformat ( ) + 'Z' print ( 'Getting the upcoming 10 events' ) eventsResult = service . events ( ) . list ( calendarId = 'primary' , timeMin = now , maxResults = 10 , singleEvents = False , orderBy = 'startTime' ) . execute ( ) events = eventsResult . get ( 'items' , [ ] ) if not events : print ( 'No upcoming events found.' ) for event in events : pprint ( event )
Shows basic usage of the Google Calendar API.
Shows basic usage of the Google Calendar API .
"""Shows basic usage of the Google Calendar API.

    Creates a Google Calendar API service object and outputs a list of the next
    10 events on the user's calendar.
    """ # 'Z' indicates UTC time #start = event['start'].get('dateTime', event['start'].get('date')) #print(start, event['summary'])