(June-December 2016) Most of the answers here are out of date: 1) GData APIs are previous generation Google APIs, and therefore @ Josh Brown found it difficult to find this old GData Docs API documentation. Although not all GData APIs are out of date, more and more new Google APIs do not use the Google Data protocol ; and 2) Google has released the new Google Sheets API (not GData). To use the new API, you need to get the Google API client library for Python (it's as simple as pip install -U google-api-python-client [or pip3 for Python 3]) and use the latest Sheets v4 + API , which is much more powerful and flexible than older versions of the API.
Here is one sample code from white papers to help you get started. However, here are a few longer, more โrealโ examples of using the API that you can learn from (video plus blog posts):
The latest Sheets API provides functions not available in earlier versions, namely it provides developers programmatic access to Sheet as if you were using the user interface (creating frozen rows, formatting cells, resizing rows / columns, adding pivot tables, creating charts, etc. .d.) ..), but NOT as if it were some kind of database on which you could search and retrieve selected rows. You should basically build a query layer on top of the API that does this. One option is to use the Google Charts Visualization API query language , which supports queries like SQL . You can also request from within the sheet itself . Remember that this functionality existed before API v4, and that the security model was updated in August 2016 . To find out more, check out my G + resource for the full -U p entry from Google Developer Expert .
Also note that the API sheets are primarily for programmatically accessing spreadsheets & functionality as described above, but for executing -level file access , such as import / export, copying, moving, renaming, etc., use the API Google Drive instead. Drive API usage examples:
(*) - TL; DR: Download a simple text file to disk, import / convert to Google Docs format, and then export this document to PDF. The post above uses Drive API v2; this follow-up post -U p describes porting it to the Drive API v3, and here is a developer video that combines both the poor converter posts.
To learn more about how to use the Google APIs with Python in general, check out my blog, as well as the many videos for Google developers ( series 1 and series 2 ) that I make.
ps. As for Google Docs, the REST API is currently unavailable, therefore the only way to programmatically access the Doc is to use the Google Apps script (which, like Node.js, is JavaScript outside the browser, but instead of running these applications on the Node server work in the Google cloud; also see my introductory video .) Using the Apps script, you can create a Docs application or add-on for Docs (and other applications like Sheets & Forms).
UPDATE July 2018 : The aforementioned ps. no longer true. The G Suite development team previously announced the new Google Docs REST API on Google Cloud NEXT '18. Developers interested in gaining access to the early access program for the new API should register at https://developers.google.com/docs .
UPDATE February 2019 : The Docs API, launched for preview in July last year, is now available mainly for everyone ... read the launch post for more details.