Skip to content

Instantly share code, notes, and snippets.

@swinton
Created July 6, 2010 15:27
Show Gist options
  • Save swinton/465526 to your computer and use it in GitHub Desktop.
Save swinton/465526 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Generate an auth_token for access to a hosted Google Docs account using the Google Docs API
See: http://code.google.com/apis/documents/overview.html
"""
import gdata.docs.client
client = gdata.docs.client.DocsClient(source='yourCo-yourAppName-v1')
client.ssl = True # Force all API requests through HTTPS
client.http_client.debug = False # Set to True for debugging HTTP requests
client.ClientLogin('your-email-address@example.com', 'pa$$w0rd', account_type='HOSTED', source=client.source)
print client.auth_token.token_string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment