GDataCopier provides a command line tool called 'gdoc-cp' that allows system administrators to automate bi-directional copy of documents & spreadsheets between local machines and Google document servers.
It also presents Python programmers with an API to incorporate document/spreadsheet download and import features into their applications.
GDataCopier requires the Google Data API to function.
Warning: GDataCopier is known to have issues with Google accounts that have never been used before, please ensure you have used your Google account via the web interface at least once.
Important notice: Currently GDataCopier only works for Gmail accounts
Due to the recent changes in the way Google's document servers work, GDataCopier is KNOWN NOT TO WORK in many instances if the account is not a Gmail account (e.g Hosted or external document accounts). Since we expect Google to change their the server side code consistently resulting in our scripts failing to work for non-Gmail account, the project has decided not to support non-Gmail accounts until the download feature becomes official in the Google API (refer to this posted issue).
Google Data API has a feature request registered here.
For System Administrators
gdatacopier provides a 'cp' like command line tool allowing users to copy documents to and from the Google servers. Its designed to automate local backups of your Google documents and spreadsheets.
Examples:
Download all your Google documents and spreadsheets in PDF to a directory called files
./gdoc-cp.py --username someone@gmail.com --export pdf --google-id all --local files
To download all documents in OpenOffice formats, use the default format option
./gdoc-cp.py --username someone@gmail.com --export default --google-id all --local files
Or, to list all your Google documents and spreadsheets (note, the password is provided as a parameter)
./gdoc-cp.py --username someone@gmail.com --password password --list-all
To import a document to your Google Doc account
./gdoc-cp.py --username someone@gmail.com --import --local files/doc.txt --title "New Document"
GDataCopier requires Python 2.4 or above and the GData Python API 1.0.8 or above.
Development version
If you are keen to download the development version, then you can try out some of our newest features. Please note that the command line options for the forthcoming 1.1 release are different to the stable release.
Please read the 103TaskList for a complete rundown of the upcoming release.
You will require GData 1.1 and Python 2.5 to use GDataCopier 1.1
Some compelling new features are:
- Support for Google presentations
- Support for Folders (or tags)
- Code rewrite to use the new GData 1.1 API
List all documents, spreadsheets and presentations that are in the folder "DBW Documentation"
./gdoc-cp.py -l -f "DBW Documentation" -u someone@gmail.com
Download all documents that are in the "DBW Documentation" folder
./gdoc-cp.py -e pdf -g all -o /tmp -u someone@gmail.com -f "DBW Documentation"
Export all presentations in the PowerPoint format
./gdoc-cp.py -e ppt -g presentations -o /tmp -u someone@gmail.com
For Developers
GDataCopier is an API for Python programmers to:
- Download documents and spreadsheets to various formats
- Upload documents and spreadsheets from various file formats to the Google docs system
- List useful information about documents on the Google servers
This is done using placing various RESTful calls (documented in the Wiki) and extracting information from the Atom feeds via the Google Data API.
The API supports these functions for both Google and Hosted accounts.
Code example to export a document:
from gdatacopier import *
copier = GDataCopier()
copier.login("someone@gmail.com", "password")
copier.cache_document_lists()
copier.export_document("adocumentid", GoogleDocFormat.OOWriter, "files/something.odt")
copier.logout()Who made GDataCopier?
Note: GDataCopier is not affiliated with Google in anyway.
De Bortoli Wines is one of the largest family owned wineries in Australia and is committed to Open Source and Open Standards. Amongst other projects they funded the development of GDataCopier. Read their Wikipedia article to learn more.
Devraj works as the principal consultant for Eternity Technologies, an Open Source solutions company located in regional New South Wales, Australia and developed GDataCopier.
If you found GDataCopier useful and are feeling extremely generous then you may want to consider looking at Devraj's Amazon Wish List.
