Exporting documents from google docs via a python api


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
17 views
simple code to export from google docs
# -*- coding: utf-8 -*- import gdata.docs import gdata.docs.service gd_client = gdata.docs.service.DocsService() gd_client.ClientLogin('login@gmail.com', 'superpassword') #download file print.html in google docs ms = gdata.MediaSource(file_path='print.html', content_type="text/html") entry = gd_client.Upload(ms, 'NewDocument') #export the file to doc file_path = 'print.doc' gd_client.Export(entry, file_path) 


the output file format is pdf and not doc.
by | 17 views

3 Answers

0 like 0 dislike
pdb debugger helped to find the problem)
generally in the file gdata/docs/service.py in function _DownloadFile() in the beginning added:
\r
 uri = uri.replace("export/","") 

not the correct uri was formed for some reason.
by
0 like 0 dislike
Here blog.programmableweb.com/2009/02/20/google-api-now-lets-you-get-documents-in-many-formats/ seems to have what you need — there's a link to examples in several languages, I understand. Yes, the Protocol version 3.0, what Labs
by
0 like 0 dislike
probably we should fix the api or a wrapper to do
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
27,372 users