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()
    http = credentials.authorize(httplib2.Http())
    service = discovery.build('calendar', 'v3', http=http)

    now = datetime.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=True,
        orderBy='startTime').execute()
    events = eventsResult.get('items', [])

    # if not events:
    #     print('No upcoming events found.')
    # for event in events:
    #     start = event['start'].get('dateTime', event['start'].get('date'))
    #     print(start, event['summary'])

    event = {
      'summary': 'Meeting',
      'location': '800 Howard St., San Francisco, CA 94103',
      'description': 'Meet with '+people,
      'start': {
        'dateTime': datestartstr,
        'timeZone': 'America/Chicago',
      },
      'end': {
        'dateTime': dateendstr,
        'timeZone': 'America/Chicago',
      },
      'recurrence': [
        'RRULE:FREQ=DAILY;COUNT=1'
      ],
      'attendees': [
        {'email': 'lpage@example.com'},
        {'email': 'sbrin@example.com'},
      ],
      'reminders': {
        'useDefault': False,
        'overrides': [
          {'method': 'email', 'minutes': 24 * 60},
          {'method': 'popup', 'minutes': 10},
        ],
      },
    }

    event = service.events().insert(calendarId='primary', body=event).execute()
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()
    http = credentials.authorize(httplib2.Http())
    service = discovery.build('calendar', 'v3', http=http)
    now = datetime.datetime.utcnow().isoformat() + 'Z' 
    print('Getting the upcoming 10 events')
    eventsResult = service.events().list(
        calendarId='primary', timeMin=now, maxResults=10, singleEvents=True,
        orderBy='startTime').execute()
    events = eventsResult.get('items', [])
    event = {
      'summary': 'Meeting',
      'location': '800 Howard St., San Francisco, CA 94103',
      'description': 'Meet with '+people,
      'start': {
        'dateTime': datestartstr,
        'timeZone': 'America/Chicago',
      },
      'end': {
        'dateTime': dateendstr,
        'timeZone': 'America/Chicago',
      },
      'recurrence': [
        'RRULE:FREQ=DAILY;COUNT=1'
      ],
      'attendees': [
        {'email': 'lpage@example.com'},
        {'email': 'sbrin@example.com'},
      ],
      'reminders': {
        'useDefault': False,
        'overrides': [
          {'method': 'email', 'minutes': 24 * 60},
          {'method': 'popup', 'minutes': 10},
        ],
      },
    }
    event = service.events().insert(calendarId='primary', body=event).execute()
def main ( ) : credentials = get_credentials ( ) http = credentials . authorize ( httplib2 . Http ( ) ) service = discovery . build ( 'calendar' , 'v3' , http = http ) now = datetime . datetime . utcnow ( ) . isoformat ( ) + 'Z' print ( 'Getting the upcoming 10 events' ) eventsResult = service . events ( ) . list ( calendarId = 'primary' , timeMin = now , maxResults = 10 , singleEvents = True , orderBy = 'startTime' ) . execute ( ) events = eventsResult . get ( 'items' , [ ] ) event = { 'summary' : 'Meeting' , 'location' : '800 Howard St., San Francisco, CA 94103' , 'description' : 'Meet with ' + people , 'start' : { 'dateTime' : datestartstr , 'timeZone' : 'America/Chicago' , } , 'end' : { 'dateTime' : dateendstr , 'timeZone' : 'America/Chicago' , } , 'recurrence' : [ 'RRULE:FREQ=DAILY;COUNT=1' ] , 'attendees' : [ { 'email' : 'lpage@example.com' } , { 'email' : 'sbrin@example.com' } , ] , 'reminders' : { 'useDefault' : False , 'overrides' : [ { 'method' : 'email' , 'minutes' : 24 * 60 } , { 'method' : 'popup' , 'minutes' : 10 } , ] , } , } event = service . events ( ) . insert ( calendarId = 'primary' , body = event ) . execute ( )
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 # if not events: #     print('No upcoming events found.') # for event in events: #     start = event['start'].get('dateTime', event['start'].get('date')) #     print(start, event['summary'])