gdata.docs.client | index /home/afshar/working/gdata-python-client/src/gdata/docs/client.py

`DocsClient simplifies interactions with the Documents List API.`

Modules
`` |  |
atom copy | gdata mimetypes | re urllib |

Classes
`` |  | gdata.client.GDClient(atom.client.AtomPubClient) DocsClient gdata.client.Query(__builtin__.object) DocsQuery
class DocsClient(gdata.client.GDClient)
`` | `Client for all features of the Google Documents List API.`
| Method resolution order: DocsClient gdata.client.GDClient atom.client.AtomPubClient __builtin__.object Methods defined here: AddAclEntry = add_acl_entry(self, resource, acl_entry, send_notifications=None, **kwargs) BatchProcessAclEntries = batch_process_acl_entries(self, resource, entries, **kwargs) CopyResource = copy_resource(self, entry, title, **kwargs) CreateArchive = create_archive(self, entry, **kwargs) CreateResource = create_resource(self, entry, media=None, collection=None, create_uri=None, **kwargs) DeleteAclEntry = delete_acl_entry(self, entry, **kwargs) DeleteArchive = delete_archive(self, entry, **kwargs) DeleteResource = delete_resource(self, entry, permanent=False, **kwargs) DeleteRevision = delete_revision(self, entry, **kwargs) DownloadArchive = download_resource(self, entry, file_path, extra_params=None, **kwargs) DownloadArchiveToMemory = download_resource_to_memory(self, entry, extra_params=None, **kwargs) DownloadResource = download_resource(self, entry, file_path, extra_params=None, **kwargs) DownloadResourceToMemory = download_resource_to_memory(self, entry, extra_params=None, **kwargs) DownloadRevision = download_revision(self, entry, file_path, extra_params=None, **kwargs) DownloadRevisionToMemory = download_revision_to_memory(self, entry, extra_params=None, **kwargs) GetAcl = get_acl(self, entry, **kwargs) GetAclEntry = get_acl_entry(self, entry, **kwargs) GetAclEntryBySelfLink = get_acl_entry_by_self_link(self, self_link, **kwargs) GetAllResources = get_all_resources(self, uri=None, show_root=None, **kwargs) GetArchive = get_archive(self, entry, **kwargs) GetArchiveBySelfLink = get_archive_by_self_link(self, self_link, **kwargs) GetChanges = get_changes(self, changestamp=None, max_results=None, show_root=None, **kwargs) GetMetadata = get_metadata(self, **kwargs) GetResource = get_resource(self, entry, **kwargs) GetResourceAcl = get_resource_acl(self, entry, **kwargs) GetResourceById = get_resource_by_id(self, resource_id, **kwargs) GetResourceBySelfLink = get_resource_by_self_link(self, uri, etag=None, show_root=None, **kwargs) GetResources = get_resources(self, uri=None, limit=None, show_root=None, **kwargs) GetRevision = get_revision(self, entry, **kwargs) GetRevisionBySelfLink = get_revision_by_self_link(self, self_link, **kwargs) GetRevisions = get_revisions(self, entry, **kwargs) MoveResource = move_resource(self, entry, collection=None, keep_in_collections=False, **kwargs) PublishRevision = publish_revision(self, entry, publish_auto=None, publish_outside_domain=False, **kwargs) Request = request(self, method=None, uri=None, **kwargs) UnpublishRevision = unpublish_revision(self, entry, **kwargs) UpdateAclEntry = update_acl_entry(self, entry, send_notifications=None, **kwargs) UpdateArchive = update_archive(self, entry, **kwargs) UpdateResource = update_resource(self, entry, media=None, update_metadata=True, new_revision=False, **kwargs) add_acl_entry(self, resource, acl_entry, send_notifications=None, **kwargs) `Adds the given AclEntry to the given Resource. Args: resource: gdata.docs.data.Resource to which to add AclEntry. acl_entry: gdata.docs.data.AclEntry representing ACL entry to add. send_notifications: True if users should be notified by email when this AclEntry is added. kwargs: Other parameters to pass to post(). Returns: gdata.docs.data.AclEntry containing information about new entry. Raises: ValueError: If given resource has no ACL link.` batch_process_acl_entries(self, resource, entries, **kwargs) `Applies the specified operation of each entry in a single request. To use this, simply set acl_entry.batch_operation to one of ['query', 'insert', 'update', 'delete'], and optionally set acl_entry.batch_id to a string of your choice. Then, put all of your modified AclEntry objects into a list and pass that list as the entries parameter. Args: resource: gdata.docs.data.Resource to which the given entries belong. entries: [gdata.docs.data.AclEntry] to modify in some way. kwargs: Other args to pass to gdata.client.GDClient.post() Returns: Resulting gdata.docs.data.AclFeed of changes.` copy_resource(self, entry, title, **kwargs) `Copies the given entry to a new entry with the given title. Note: Files do not support this feature. Args: entry: gdata.docs.data.Resource to copy. title: String title for the new entry. kwargs: Other parameters to pass to post(). Returns: gdata.docs.data.Resource representing duplicated resource.` create_archive(self, entry, **kwargs) `Creates a new archive of resources. Args: entry: gdata.docs.data.Archive representing metadata of archive to create. kwargs: Other parameters to pass to post(). Returns: gdata.docs.data.Archive containing information about new archive.` create_resource(self, entry, media=None, collection=None, create_uri=None, **kwargs) `Creates new entries in Google Docs, and uploads their contents. Args: entry: gdata.docs.data.Resource representing initial version of entry being created. If media is also provided, the entry will first be created with the given metadata and content. media: (optional) gdata.data.MediaSource containing the file to be uploaded. collection: (optional) gdata.docs.data.Resource representing a collection in which this new entry should be created. If provided along with create_uri, create_uri will win (e.g. entry will be created at create_uri, not necessarily in given collection). create_uri: (optional) String URI at which to create the given entry. If collection, media and create_uri are None, use gdata.docs.client.RESOURCE_FEED_URI. If collection and create_uri are None, use gdata.docs.client.RESOURCE_UPLOAD_URI. If collection and media are not None, collection.GetResumableCreateMediaLink() is used, with the collection's resource ID substituted in. kwargs: Other parameters to pass to post() and update(). Returns: gdata.docs.data.Resource containing information about new entry.` delete_acl_entry(self, entry, **kwargs) `Deletes the given AclEntry. Args: entry: gdata.docs.data.AclEntry to delete. kwargs: Other args to pass to gdata.client.GDClient.Delete() Returns: Result of delete request.` delete_archive(self, entry, **kwargs) `Aborts the given Archive operation, or deletes the Archive. Args: entry: gdata.docs.data.Archive to delete. kwargs: Other args to pass to gdata.client.GDClient.Delete() Returns: Result of delete request.` delete_resource(self, entry, permanent=False, **kwargs) `Trashes or deletes the given entry. Args: entry: gdata.docs.data.Resource to trash or delete. permanent: True to skip the trash and delete the entry forever. kwargs: Other args to pass to gdata.client.GDClient.Delete() Returns: Result of delete request.` delete_revision(self, entry, **kwargs) `Deletes the given Revision. Args: entry: gdata.docs.data.Revision to delete. kwargs: Other args to pass to gdata.client.GDClient.Delete() Returns: Result of delete request.` download_archive = download_resource(self, entry, file_path, extra_params=None, **kwargs) download_archive_to_memory = download_resource_to_memory(self, entry, extra_params=None, **kwargs) download_resource(self, entry, file_path, extra_params=None, **kwargs) `Downloads the contents of the given entry to disk. Note: to download a file in memory, use the DownloadResourceToMemory() method. Args: entry: gdata.docs.data.Resource whose contents to fetch. file_path: str Full path to which to save file. extra_params: dict (optional) A map of any further parameters to control how the document is downloaded/exported. For example, exporting a spreadsheet as a .csv: extra_params={'gid': 0, 'exportFormat': 'csv'} kwargs: Other parameters to pass to _download_file(). Raises: gdata.client.RequestError if the download URL is malformed or the server's response was not successful.` download_resource_to_memory(self, entry, extra_params=None, **kwargs) `Returns the contents of the given entry. Args: entry: gdata.docs.data.Resource whose contents to fetch. extra_params: dict (optional) A map of any further parameters to control how the document is downloaded/exported. For example, exporting a spreadsheet as a .csv: extra_params={'gid': 0, 'exportFormat': 'csv'} kwargs: Other parameters to pass to _get_content(). Returns: Content of given resource after being downloaded. Raises: gdata.client.RequestError if the download URL is malformed or the server's response was not successful.` download_revision(self, entry, file_path, extra_params=None, **kwargs) `Downloads the contents of the given revision to disk. Note: to download a revision in memory, use the DownloadRevisionToMemory() method. Args: entry: gdata.docs.data.Revision whose contents to fetch. file_path: str Full path to which to save file. extra_params: dict (optional) A map of any further parameters to control how the document is downloaded. kwargs: Other parameters to pass to _download_file(). Raises: gdata.client.RequestError if the download URL is malformed or the server's response was not successful.` download_revision_to_memory(self, entry, extra_params=None, **kwargs) `Returns the contents of the given revision. Args: entry: gdata.docs.data.Revision whose contents to fetch. extra_params: dict (optional) A map of any further parameters to control how the document is downloaded/exported. kwargs: Other parameters to pass to _get_content(). Returns: Content of given revision after being downloaded. Raises: gdata.client.RequestError if the download URL is malformed or the server's response was not successful.` get_acl(self, entry, **kwargs) `Retrieves an AclFeed for the given resource. Args: entry: gdata.docs.data.Resource to fetch AclFeed for. kwargs: Other args to pass to GetFeed(). Returns: gdata.docs.data.AclFeed representing retrieved entries.` get_acl_entry(self, entry, **kwargs) `Retrieves an AclEntry again. This is useful if you need to poll for an ACL changing. Args: entry: gdata.docs.data.AclEntry to fetch and return. kwargs: Other args to pass to GetAclEntryBySelfLink(). Returns: gdata.docs.data.AclEntry representing retrieved entry.` get_acl_entry_by_self_link(self, self_link, **kwargs) `Retrieves a particular AclEntry by its self link. Args: self_link: URI at which to query for given ACL entry. This can be found using entry.GetSelfLink(). kwargs: Other parameters to pass to get_entry(). Returns: gdata.docs.data.AclEntry representing the retrieved entry.` get_all_resources(self, uri=None, show_root=None, **kwargs) `Retrieves all of a user's non-collections or everything at the given URI. Folders are not included in this by default. Pass in a custom URI to include collections in your query. The DocsQuery class is an easy way to generate such a URI. This method makes multiple HTTP requests (by following the feed's next links) in order to fetch the user's entire document list. Args: uri: (optional) URI to query the doclist feed with. If None, then use DocsClient.RESOURCE_FEED_URI, which will retrieve all non-collections. show_root: (optional) True to include indications if a resource is in the root collection. kwargs: Other parameters to pass to GetResources(). Returns: List of gdata.docs.data.Resource objects representing the retrieved entries.` get_archive(self, entry, **kwargs) `Retrieves an archive again given its entry. This is useful if you need to poll for an archive completing. Args: entry: gdata.docs.data.Archive to fetch and return. kwargs: Other args to pass to GetArchiveBySelfLink(). Returns: gdata.docs.data.Archive representing retrieved archive.` get_archive_by_self_link(self, self_link, **kwargs) `Retrieves a particular archive by its self link. Args: self_link: URI at which to query for given archive. This can be found using entry.GetSelfLink(). kwargs: Other parameters to pass to get_entry(). Returns: gdata.docs.data.Archive representing the retrieved archive.` get_changes(self, changestamp=None, max_results=None, show_root=None, **kwargs) `Retrieves changes to a user's documents list. Args: changestamp: (optional) String changestamp value to query since. If provided, returned changes will have a changestamp larger than the given one. max_results: (optional) Number of results to fetch. API will limit this number to 100 at most. show_root: (optional) True to include indications if a resource is in the root collection. kwargs: Other parameters to pass to get_feed(). Returns: gdata.docs.data.ChangeFeed.` get_metadata(self, **kwargs) `Retrieves the metadata of a user account. Args: kwargs: Other parameters to pass to get_entry(). Returns: gdata.docs.data.Metadata representing metadata of user's account.` get_resource(self, entry, **kwargs) `Retrieves a resource again given its entry. Args: entry: gdata.docs.data.Resource to fetch and return. kwargs: Other args to pass to GetResourceBySelfLink(). Returns: gdata.docs.data.Resource representing retrieved resource.` get_resource_acl(self, entry, **kwargs) `Retrieves the ACL sharing permissions for the given entry. Args: entry: gdata.docs.data.Resource for which to get ACL. kwargs: Other parameters to pass to get_feed(). Returns: gdata.docs.data.AclFeed representing the resource's ACL.` get_resource_by_id(self, resource_id, **kwargs) `Retrieves a resource again given its resource ID. Args: resource_id: Typed or untyped resource ID of a resource. kwargs: Other args to pass to GetResourceBySelfLink(). Returns: gdata.docs.data.Resource representing retrieved resource.` get_resource_by_self_link(self, uri, etag=None, show_root=None, **kwargs) `Retrieves a particular resource by its self link. Args: uri: str URI at which to query for given resource. This can be found using entry.GetSelfLink(). etag: str (optional) The document/item's etag value to be used in a conditional GET. See http://code.google.com/apis/documents/docs/3.0/ developers_guide_protocol.html#RetrievingCached. show_root: (optional) True to include indications if a resource is in the root collection. kwargs: Other parameters to pass to get_entry(). Returns: gdata.docs.data.Resource representing the retrieved resource.` get_resources(self, uri=None, limit=None, show_root=None, **kwargs) `Retrieves the resources in a user's docslist, or the given URI. Args: uri: (optional) URI to query for resources. If None, then gdata.docs.client.DocsClient.RESOURCE_FEED_URI is used, which will query for all non-collections. limit: int (optional) A maximum cap for the number of results to return in the feed. By default, the API returns a maximum of 100 per page. Thus, if you set limit=5000, you will get <= 5000 documents (guarenteed no more than 5000), and will need to follow the feed's next links (feed.GetNextLink()) to the rest. See get_everything(). Similarly, if you set limit=50, only <= 50 documents are returned. Note: if the max-results parameter is set in the uri parameter, it is chosen over a value set for limit. show_root: (optional) True to include indications if a resource is in the root collection. kwargs: Other parameters to pass to get_feed(). Returns: gdata.docs.data.ResourceFeed feed.` get_revision(self, entry, **kwargs) `Retrieves a revision again given its entry. Args: entry: gdata.docs.data.Revision to fetch and return. kwargs: Other args to pass to GetRevisionBySelfLink(). Returns: gdata.docs.data.Revision representing retrieved revision.` get_revision_by_self_link(self, self_link, **kwargs) `Retrieves a particular reivision by its self link. Args: self_link: URI at which to query for given revision. This can be found using entry.GetSelfLink(). kwargs: Other parameters to pass to get_entry(). Returns: gdata.docs.data.Revision representing the retrieved revision.` get_revisions(self, entry, **kwargs) `Retrieves the revision history for a resource. Args: entry: gdata.docs.data.Resource for which to get revisions. kwargs: Other parameters to pass to get_feed(). Returns: gdata.docs.data.RevisionFeed representing the resource's revisions.` move_resource(self, entry, collection=None, keep_in_collections=False, **kwargs) `Moves an item into a different collection (or out of all collections). Args: entry: gdata.docs.data.Resource to move. collection: gdata.docs.data.Resource (optional) An object representing the destination collection. If None, set keep_in_collections to False to remove the item from all collections. keep_in_collections: boolean (optional) If True, the given entry is not removed from any existing collections it is already in. kwargs: Other parameters to pass to post(). Returns: gdata.docs.data.Resource of the moved entry.` publish_revision(self, entry, publish_auto=None, publish_outside_domain=False, **kwargs) `Publishes the given revision. This method can only be used for document revisions. Args: entry: Revision to update. publish_auto: True to automatically publish future revisions of the document. False to not automatically publish future revisions. None to take no action and use the default value. publish_outside_domain: True to make the published revision available outside of a Google Apps domain. False to not publish outside the domain. None to use the default value. kwargs: Other parameters to pass to super(DocsClient, self).update(). Returns: gdata.docs.data.Revision representing the updated revision.` request(self, method=None, uri=None, **kwargs) `Add support for imitating other users via 2-Legged OAuth. Args: uri: (optional) URI of the request in which to replace default with self.xoauth_requestor_id. Returns: Result of super(DocsClient, self).request().` unpublish_revision(self, entry, **kwargs) `Unpublishes the given revision. This method can only be used for document revisions. Args: entry: Revision to update. kwargs: Other parameters to pass to super(DocsClient, self).update(). Returns: gdata.docs.data.Revision representing the updated revision.` update_acl_entry(self, entry, send_notifications=None, **kwargs) `Updates the given AclEntry with new metadata. Args: entry: AclEntry to update. Make any metadata changes to this entry. send_notifications: True if users should be notified by email when this AclEntry is updated. kwargs: Other parameters to pass to super(DocsClient, self).update(). Returns: gdata.docs.data.AclEntry representing the updated ACL entry.` update_archive(self, entry, **kwargs) `Updates the given Archive with new metadata. This method is really only useful for updating the notification email address of an archive that is being processed. Args: entry: Archive to update. Make any metadata changes to this entry. kwargs: Other parameters to pass to super(DocsClient, self).update(). Returns: gdata.docs.data.Archive representing the updated archive.` update_resource(self, entry, media=None, update_metadata=True, new_revision=False, **kwargs) `Updates an entry in Google Docs with new metadata and/or new data. Args: entry: Entry to update. Make any metadata changes to this entry. media: (optional) gdata.data.MediaSource object containing the file with which to replace the entry's data. update_metadata: (optional) True to update the metadata from the entry itself. You might set this to False to only update an entry's file content, and not its metadata. new_revision: (optional) True to create a new revision with this update, False otherwise. kwargs: Other parameters to pass to post(). Returns: gdata.docs.data.Resource representing the updated entry.` Data and other attributes defined here: alt_auth_service = 'wise' alt_auth_token = None api_version = '3.0' auth_scopes = ('https://docs.google.com/feeds/', 'https://spreadsheets.google.com/feeds/', 'https://docs.googleusercontent.com/') auth_service = 'writely' host = 'docs.google.com' ssl = True Methods inherited from gdata.client.GDClient: Batch = batch(self, feed, uri=None, force=False, auth_token=None, **kwargs) `Sends a batch request to the server to execute operation entries. Args: feed: A batch feed containing batch entries, each is an operation. uri: (optional) The uri to which the batch request feed should be POSTed. If none is provided, then the feed's edit link will be used. force: (optional) boolean set to True if you want the batch update to clobber all data. If False, the version in the information in the feed object will cause the server to check to see that no changes intervened between when you fetched the data and when you sent the changes. auth_token: (optional) An object which sets the Authorization HTTP header in its modify_request method. Recommended classes include gdata.gauth.ClientLoginToken and gdata.gauth.AuthSubToken among others.` ClientLogin = client_login(self, email, password, source, service=None, account_type='HOSTED_OR_GOOGLE', auth_url=<atom.http_core.Uri object>, captcha_token=None, captcha_response=None) `Performs an auth request using the user's email address and password. In order to modify user specific data and read user private data, your application must be authorized by the user. One way to demonstrage authorization is by including a Client Login token in the Authorization HTTP header of all requests. This method requests the Client Login token by sending the user's email address, password, the name of the application, and the service code for the service which will be accessed by the application. If the username and password are correct, the server will respond with the client login code and a new ClientLoginToken object will be set in the client's auth_token member. With the auth_token set, future requests from this client will include the Client Login token. For a list of service names, see http://code.google.com/apis/gdata/faq.html#clientlogin For more information on Client Login, see: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html Args: email: str The user's email address or username. password: str The password for the user's account. source: str The name of your application. This can be anything you like but should should give some indication of which app is making the request. service: str The service code for the service you would like to access. For example, 'cp' for contacts, 'cl' for calendar. For a full list see http://code.google.com/apis/gdata/faq.html#clientlogin If you are using a subclass of the gdata.client.GDClient, the service will usually be filled in for you so you do not need to specify it. For example see BloggerClient, SpreadsheetsClient, etc. account_type: str (optional) The type of account which is being authenticated. This can be either 'GOOGLE' for a Google Account, 'HOSTED' for a Google Apps Account, or the default 'HOSTED_OR_GOOGLE' which will select the Google Apps Account if the same email address is used for both a Google Account and a Google Apps Account. auth_url: str (optional) The URL to which the login request should be sent. captcha_token: str (optional) If a previous login attempt was reponded to with a CAPTCHA challenge, this is the token which identifies the challenge (from the CAPTCHA's URL). captcha_response: str (optional) If a previous login attempt was reponded to with a CAPTCHA challenge, this is the response text which was contained in the challenge. Returns: Generated token, which is also stored in this object. Raises: A RequestError or one of its suclasses: BadAuthentication, BadAuthenticationServiceURL, ClientLoginFailed, ClientLoginTokenMissing, or CaptchaChallenge` Delete = delete(self, entry_or_uri, auth_token=None, force=False, **kwargs) GetAccessToken = get_access_token(self, request_token, url='https://www.google.com/accounts/OAuthGetAccessToken') `Exchanges an authorized OAuth request token for an access token. Contacts the Google OAuth server to upgrade a previously authorized request token. Once the request token is upgraded to an access token, the access token may be used to access the user's data. For more details, see the Google Accounts OAuth documentation: http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken Args: request_token: An OAuth token which has been authorized by the user. url: (optional) The URL to which the upgrade request should be sent. Defaults to: https://www.google.com/accounts/OAuthAuthorizeToken` GetEntry = get_entry(self, uri, auth_token=None, converter=None, desired_class=<class 'gdata.data.GDEntry'>, etag=None, **kwargs) GetFeed = get_feed(self, uri, auth_token=None, converter=None, desired_class=<class 'gdata.data.GDFeed'>, **kwargs) GetNext = get_next(self, feed, auth_token=None, converter=None, desired_class=None, **kwargs) `Fetches the next set of results from the feed. When requesting a feed, the number of entries returned is capped at a service specific default limit (often 25 entries). You can specify your own entry-count cap using the max-results URL query parameter. If there are more results than could fit under max-results, the feed will contain a next link. This method performs a GET against this next results URL. Returns: A new feed object containing the next set of entries in this feed.` GetOAuthToken = get_oauth_token(self, scopes, next, consumer_key, consumer_secret=None, rsa_private_key=None, url='https://www.google.com/accounts/OAuthGetRequestToken') `Obtains an OAuth request token to allow the user to authorize this app. Once this client has a request token, the user can authorize the request token by visiting the authorization URL in their browser. After being redirected back to this app at the 'next' URL, this app can then exchange the authorized request token for an access token. For more information see the documentation on Google Accounts with OAuth: http://code.google.com/apis/accounts/docs/OAuth.html#AuthProcess Args: scopes: list of strings or atom.http_core.Uri objects which specify the URL prefixes which this app will be accessing. For example, to access the Google Calendar API, you would want to use scopes: ['https://www.google.com/calendar/feeds/', 'http://www.google.com/calendar/feeds/'] next: str or atom.http_core.Uri object, The URL which the user's browser should be sent to after they authorize access to their data. This should be a URL in your application which will read the token information from the URL and upgrade the request token to an access token. consumer_key: str This is the identifier for this application which you should have received when you registered your application with Google to use OAuth. consumer_secret: str (optional) The shared secret between your app and Google which provides evidence that this request is coming from you application and not another app. If present, this libraries assumes you want to use an HMAC signature to verify requests. Keep this data a secret. rsa_private_key: str (optional) The RSA private key which is used to generate a digital signature which is checked by Google's server. If present, this library assumes that you want to use an RSA signature to verify requests. Keep this data a secret. url: The URL to which a request for a token should be made. The default is Google's OAuth request token provider.` ModifyRequest = modify_request(self, http_request) `Adds or changes request before making the HTTP request. This client will add the API version if it is specified. Subclasses may override this method to add their own request modifications before the request is made.` Post = post(self, entry, uri, auth_token=None, converter=None, desired_class=None, **kwargs) RequestClientLoginToken = request_client_login_token(self, email, password, source, service=None, account_type='HOSTED_OR_GOOGLE', auth_url=<atom.http_core.Uri object>, captcha_token=None, captcha_response=None) RevokeToken = revoke_token(self, token=None, url=<atom.http_core.Uri object>) `Requests that the token be invalidated. This method can be used for both AuthSub and OAuth tokens (to invalidate a ClientLogin token, the user must change their password). Returns: True if the server responded with a 200. Raises: A RequestError if the server responds with a non-200 status.` Update = update(self, entry, auth_token=None, force=False, uri=None, **kwargs) `Edits the entry on the server by sending the XML for this entry. Performs a PUT and converts the response to a new entry object with a matching class to the entry passed in. Args: entry: auth_token: force: boolean stating whether an update should be forced. Defaults to False. Normally, if a change has been made since the passed in entry was obtained, the server will not overwrite the entry since the changes were based on an obsolete version of the entry. Setting force to True will cause the update to silently overwrite whatever version is present. uri: The uri to put to. If provided, this uri is PUT to rather than the inferred uri from the entry's edit link. Returns: A new Entry object of a matching type to the entry which was passed in.` UpgradeToken = upgrade_token(self, token=None, url=<atom.http_core.Uri object>) `Asks the Google auth server for a multi-use AuthSub token. For details on AuthSub, see: http://code.google.com/apis/accounts/docs/AuthSub.html Args: token: gdata.gauth.AuthSubToken or gdata.gauth.SecureAuthSubToken (optional) If no token is passed in, the client's auth_token member is used to request the new token. The token object will be modified to contain the new session token string. url: str or atom.http_core.Uri (optional) The URL to which the token upgrade request should be sent. Defaults to: https://www.google.com/accounts/AuthSubSessionToken Returns: The upgraded gdata.gauth.AuthSubToken object.` batch(self, feed, uri=None, force=False, auth_token=None, **kwargs) `Sends a batch request to the server to execute operation entries. Args: feed: A batch feed containing batch entries, each is an operation. uri: (optional) The uri to which the batch request feed should be POSTed. If none is provided, then the feed's edit link will be used. force: (optional) boolean set to True if you want the batch update to clobber all data. If False, the version in the information in the feed object will cause the server to check to see that no changes intervened between when you fetched the data and when you sent the changes. auth_token: (optional) An object which sets the Authorization HTTP header in its modify_request method. Recommended classes include gdata.gauth.ClientLoginToken and gdata.gauth.AuthSubToken among others.` client_login(self, email, password, source, service=None, account_type='HOSTED_OR_GOOGLE', auth_url=<atom.http_core.Uri object>, captcha_token=None, captcha_response=None) `Performs an auth request using the user's email address and password. In order to modify user specific data and read user private data, your application must be authorized by the user. One way to demonstrage authorization is by including a Client Login token in the Authorization HTTP header of all requests. This method requests the Client Login token by sending the user's email address, password, the name of the application, and the service code for the service which will be accessed by the application. If the username and password are correct, the server will respond with the client login code and a new ClientLoginToken object will be set in the client's auth_token member. With the auth_token set, future requests from this client will include the Client Login token. For a list of service names, see http://code.google.com/apis/gdata/faq.html#clientlogin For more information on Client Login, see: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html Args: email: str The user's email address or username. password: str The password for the user's account. source: str The name of your application. This can be anything you like but should should give some indication of which app is making the request. service: str The service code for the service you would like to access. For example, 'cp' for contacts, 'cl' for calendar. For a full list see http://code.google.com/apis/gdata/faq.html#clientlogin If you are using a subclass of the gdata.client.GDClient, the service will usually be filled in for you so you do not need to specify it. For example see BloggerClient, SpreadsheetsClient, etc. account_type: str (optional) The type of account which is being authenticated. This can be either 'GOOGLE' for a Google Account, 'HOSTED' for a Google Apps Account, or the default 'HOSTED_OR_GOOGLE' which will select the Google Apps Account if the same email address is used for both a Google Account and a Google Apps Account. auth_url: str (optional) The URL to which the login request should be sent. captcha_token: str (optional) If a previous login attempt was reponded to with a CAPTCHA challenge, this is the token which identifies the challenge (from the CAPTCHA's URL). captcha_response: str (optional) If a previous login attempt was reponded to with a CAPTCHA challenge, this is the response text which was contained in the challenge. Returns: Generated token, which is also stored in this object. Raises: A RequestError or one of its suclasses: BadAuthentication, BadAuthenticationServiceURL, ClientLoginFailed, ClientLoginTokenMissing, or CaptchaChallenge` delete(self, entry_or_uri, auth_token=None, force=False, **kwargs) get_access_token(self, request_token, url='https://www.google.com/accounts/OAuthGetAccessToken') `Exchanges an authorized OAuth request token for an access token. Contacts the Google OAuth server to upgrade a previously authorized request token. Once the request token is upgraded to an access token, the access token may be used to access the user's data. For more details, see the Google Accounts OAuth documentation: http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken Args: request_token: An OAuth token which has been authorized by the user. url: (optional) The URL to which the upgrade request should be sent. Defaults to: https://www.google.com/accounts/OAuthAuthorizeToken` get_entry(self, uri, auth_token=None, converter=None, desired_class=<class 'gdata.data.GDEntry'>, etag=None, **kwargs) get_feed(self, uri, auth_token=None, converter=None, desired_class=<class 'gdata.data.GDFeed'>, **kwargs) get_next(self, feed, auth_token=None, converter=None, desired_class=None, **kwargs) `Fetches the next set of results from the feed. When requesting a feed, the number of entries returned is capped at a service specific default limit (often 25 entries). You can specify your own entry-count cap using the max-results URL query parameter. If there are more results than could fit under max-results, the feed will contain a next link. This method performs a GET against this next results URL. Returns: A new feed object containing the next set of entries in this feed.` get_oauth_token(self, scopes, next, consumer_key, consumer_secret=None, rsa_private_key=None, url='https://www.google.com/accounts/OAuthGetRequestToken') `Obtains an OAuth request token to allow the user to authorize this app. Once this client has a request token, the user can authorize the request token by visiting the authorization URL in their browser. After being redirected back to this app at the 'next' URL, this app can then exchange the authorized request token for an access token. For more information see the documentation on Google Accounts with OAuth: http://code.google.com/apis/accounts/docs/OAuth.html#AuthProcess Args: scopes: list of strings or atom.http_core.Uri objects which specify the URL prefixes which this app will be accessing. For example, to access the Google Calendar API, you would want to use scopes: ['https://www.google.com/calendar/feeds/', 'http://www.google.com/calendar/feeds/'] next: str or atom.http_core.Uri object, The URL which the user's browser should be sent to after they authorize access to their data. This should be a URL in your application which will read the token information from the URL and upgrade the request token to an access token. consumer_key: str This is the identifier for this application which you should have received when you registered your application with Google to use OAuth. consumer_secret: str (optional) The shared secret between your app and Google which provides evidence that this request is coming from you application and not another app. If present, this libraries assumes you want to use an HMAC signature to verify requests. Keep this data a secret. rsa_private_key: str (optional) The RSA private key which is used to generate a digital signature which is checked by Google's server. If present, this library assumes that you want to use an RSA signature to verify requests. Keep this data a secret. url: The URL to which a request for a token should be made. The default is Google's OAuth request token provider.` modify_request(self, http_request) `Adds or changes request before making the HTTP request. This client will add the API version if it is specified. Subclasses may override this method to add their own request modifications before the request is made.` post(self, entry, uri, auth_token=None, converter=None, desired_class=None, **kwargs) request_client_login_token(self, email, password, source, service=None, account_type='HOSTED_OR_GOOGLE', auth_url=<atom.http_core.Uri object>, captcha_token=None, captcha_response=None) revoke_token(self, token=None, url=<atom.http_core.Uri object>) `Requests that the token be invalidated. This method can be used for both AuthSub and OAuth tokens (to invalidate a ClientLogin token, the user must change their password). Returns: True if the server responded with a 200. Raises: A RequestError if the server responds with a non-200 status.` update(self, entry, auth_token=None, force=False, uri=None, **kwargs) `Edits the entry on the server by sending the XML for this entry. Performs a PUT and converts the response to a new entry object with a matching class to the entry passed in. Args: entry: auth_token: force: boolean stating whether an update should be forced. Defaults to False. Normally, if a change has been made since the passed in entry was obtained, the server will not overwrite the entry since the changes were based on an obsolete version of the entry. Setting force to True will cause the update to silently overwrite whatever version is present. uri: The uri to put to. If provided, this uri is PUT to rather than the inferred uri from the entry's edit link. Returns: A new Entry object of a matching type to the entry which was passed in.` upgrade_token(self, token=None, url=<atom.http_core.Uri object>) `Asks the Google auth server for a multi-use AuthSub token. For details on AuthSub, see: http://code.google.com/apis/accounts/docs/AuthSub.html Args: token: gdata.gauth.AuthSubToken or gdata.gauth.SecureAuthSubToken (optional) If no token is passed in, the client's auth_token member is used to request the new token. The token object will be modified to contain the new session token string. url: str or atom.http_core.Uri (optional) The URL to which the token upgrade request should be sent. Defaults to: https://www.google.com/accounts/AuthSubSessionToken Returns: The upgraded gdata.gauth.AuthSubToken object.` Methods inherited from atom.client.AtomPubClient: Get = get(self, uri=None, auth_token=None, http_request=None, **kwargs) `Performs a request using the GET method, returns an HTTP response.` Put = put(self, uri=None, data=None, auth_token=None, http_request=None, **kwargs) `Sends data using the PUT method, returns an HTTP response.` __init__(self, http_client=None, host=None, auth_token=None, source=None, xoauth_requestor_id=None, **kwargs) `Creates a new AtomPubClient instance. Args: source: The name of your application. http_client: An object capable of performing HTTP requests through a request method. This object is used to perform the request when the AtomPubClient's request method is called. Used to allow HTTP requests to be directed to a mock server, or use an alternate library instead of the default of httplib to make HTTP requests. host: str The default host name to use if a host is not specified in the requested URI. auth_token: An object which sets the HTTP Authorization header when its modify_request method is called.` get(self, uri=None, auth_token=None, http_request=None, **kwargs) `Performs a request using the GET method, returns an HTTP response.` put(self, uri=None, data=None, auth_token=None, http_request=None, **kwargs) `Sends data using the PUT method, returns an HTTP response.` Data descriptors inherited from atom.client.AtomPubClient: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)` Data and other attributes inherited from atom.client.AtomPubClient: auth_token = None xoauth_requestor_id = None
class DocsQuery(gdata.client.Query)
`` |  | Method resolution order: DocsQuery gdata.client.Query __builtin__.object Methods defined here: ModifyRequest = modify_request(self, http_request) __init__(self, title=None, title_exact=None, opened_min=None, opened_max=None, edited_min=None, edited_max=None, owner=None, writer=None, reader=None, show_collections=None, show_root=None, show_deleted=None, ocr=None, target_language=None, source_language=None, convert=None, query=None, **kwargs) `Constructs a query URL for the Google Documents List API. Args: title: str (optional) Specifies the search terms for the title of a document. This parameter used without title_exact will only submit partial queries, not exact queries. title_exact: str (optional) Meaningless without title. Possible values are 'true' and 'false'. Note: Matches are case-insensitive. opened_min: str (optional) Lower bound on the last time a document was opened by the current user. Use the RFC 3339 timestamp format. For example: opened_min='2005-08-09T09:57:00-08:00'. opened_max: str (optional) Upper bound on the last time a document was opened by the current user. (See also opened_min.) edited_min: str (optional) Lower bound on the last time a document was edited by the current user. This value corresponds to the edited.text value in the doc's entry object, which represents changes to the document's content or metadata. Use the RFC 3339 timestamp format. For example: edited_min='2005-08-09T09:57:00-08:00' edited_max: str (optional) Upper bound on the last time a document was edited by the user. (See also edited_min.) owner: str (optional) Searches for documents with a specific owner. Use the email address of the owner. For example: owner='user@gmail.com' writer: str (optional) Searches for documents which can be written to by specific users. Use a single email address or a comma separated list of email addresses. For example: writer='user1@gmail.com,user@example.com' reader: str (optional) Searches for documents which can be read by specific users. (See also writer.) show_collections: str (optional) Specifies whether the query should return collections as well as documents and files. Possible values are 'true' and 'false'. Default is 'false'. show_root: (optional) 'true' to specify when an item is in the root collection. Default is 'false' show_deleted: str (optional) Specifies whether the query should return documents which are in the trash as well as other documents. Possible values are 'true' and 'false'. Default is false. ocr: str (optional) Specifies whether to attempt OCR on a .jpg, .png, or .gif upload. Possible values are 'true' and 'false'. Default is false. See OCR in the Protocol Guide: http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#OCR target_language: str (optional) Specifies the language to translate a document into. See Document Translation in the Protocol Guide for a table of possible values: http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html#DocumentTranslation source_language: str (optional) Specifies the source language of the original document. Optional when using the translation service. If not provided, Google will attempt to auto-detect the source language. See Document Translation in the Protocol Guide for a table of possible values (link in target_language). convert: str (optional) Used when uploading files specify if document uploads should convert to a native Google Docs format. Possible values are 'true' and 'false'. The default is 'true'. query: str (optional) Full-text query to use. See the 'q' parameter in the documentation.` modify_request(self, http_request) Methods inherited from gdata.client.Query: AddCustomParameter = add_custom_parameter(self, key, value) add_custom_parameter(self, key, value) Data descriptors inherited from gdata.client.Query: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`

Data
`` |  | ARCHIVE_FEED_URI = '/feeds/default/private/archive' CHANGE_FEED_URI = '/feeds/default/private/changes' METADATA_URI = '/feeds/metadata/default' RESOURCE_FEED_URI = '/feeds/default/private/full' RESOURCE_SELF_LINK_TEMPLATE = '/feeds/default/private/full/%s' RESOURCE_UPLOAD_URI = '/feeds/upload/create-session/default/private/full' __author__ = 'vicfryzel@google.com (Vic Fryzel)'

Author
`` |  | vicfryzel@google.com (Vic Fryzel)