Using Google Document API, I'm trying to create new documents as well as supplying a list of all current documents within a specific folder in my Google Documents. I am starting out with python development, so I'm a little rough around the edges still.
Things I am trying to do:
- Create a collection (or folder) with name [Folder Name] ONLY if that name does not exist yet
- Create a document inside [Folder Name]
- From only [Folder Name] get a list of documents along with links to the documents themselves
I believe I am using Google Docs API 3.0 and am using gdata-2.0.16 helper for python.
Code so far:
import gdata.docs.data import gdata.docs.client class SampleConfig(object): APP_NAME = 'GDataDocumentsListAPISample-v1.0' DEBUG = False client = gdata.docs.client.DocsClient() client.ClientLogin('[email_address]','[password]',source=SampleConfig.APP_NAME ) col = gdata.docs.data.Resource(type='folder', title='Folder Name') col = client.CreateResource(col) doc = gdata.docs.data.Resource(type='document', title='I did this') doc = client.CreateResource(doc, collection=col)
So now on to the questions: Where I am hopelessly stuck:
- How do I check if [Folder name] exists?
- How to retrieve the contents of ONLY [Folder Name]?
- How do I get hold of absolute links to all documents I create in this folder?
I know I'm miles away from completion here, but any help or advice you could give would be great.
Thanks in advance!