Access Google Data API From Command Line

Googlecl is a Google utility to access Google Data API from the command line. Googlecl is written in Python. Googlecl allows you to update your Blogger blog, Picasa, Calendar, Contacts, Google Docs, and YouTube videos. This tool connects to Google services using the Google Data API. Since it is written in Python, it works cross-platform on Linux, FreeBSD, Windows, and Mac OS X.

To install GoogleCL, you need to install its dependencies:

  1. Python 2.5 or 2.6
  2. gdata >= 1.2.4 (preferably 2.0.x)

To install on Ubuntu/Debian:

1. Download the googlecl deb file.

2. Install it with this command:

sudo dpkg -i googlecl*.deb

To install on Windows:

  1. Download the googlecl for win32.
  2. Extract it and install.

To install on Mac OS X:

1. Install it from the port command:

sudo port install googlecl

For others, you can grab the source file, compile and install it:

tar xf googlecl-x.x.x.tar.gz
python setup.py install --record=files.txt

Here are some basic example commands:

  • Blogger $ google blogger post –title “foo” “command line posting”
  • Calendar $ google calendar add “Lunch with Jim at noon tomorrow”
  • Contacts $ google contacts list Bob name,email > the_bobs.csv
  • Docs $ google docs edit “Shopping list”
  • Picasa $ google picasa create “Cat Photos” ~/photos/cats/*.jpg
  • Youtube $ google youtube post –category Education killer_robots.avi

With this very useful tool, there is a lot you can do — like make a software or web application to manage your data in one place, or make automation tools for it. Just grow your idea and expand your skill. I haven’t explored it in depth yet, but I will. So stay tuned and I will write another article about googlecl.

More details: googlecl homepage. More example scripts: googlecl examples.