python - How to get the sum of outgoing emails from all users in domain with Google API? -


with following snippet google docs list of users:

def main():     """shows basic usage of google admin sdk directory api.      creates google admin sdk api service object , outputs list of first     100 users in domain.     """     credentials = get_credentials()     http = credentials.authorize(httplib2.http())     service = discovery.build('admin', 'directory_v1', http=http)      results = service.users().list(customer='my_customer', maxresults=100, orderby='email').execute()     users = results.get('users', [])      if not users:         print('no users in domain.')     else:         print('users:')          user in users:             print('{0} ({1})'.format(user['primaryemail'], user['name']['fullname']))  if __name__ == '__main__':     main() 

my goal sum of outgoing emails every user , list of email headers of outgoing mails.

i'm new google api. possible google-api-python-client?


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -