Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Install the Google command line tool UNIX
Google has released a command line tool to access many of their services. This is obviously handy for batch processing with scripts. The tool is largely written in Python and is open source, so it's highly portable and runs on the Mac.

The following services are currently supported:
  • Blogger
  • Calendar
  • Contacts
  • Docs
  • Picasa
  • Youtube


The easiest way to install these tools is using MacPorts. If you don't have MacPorts installed, the current version's installer is available on disk image from the link above. You will need to have the Apple Developer Tools installed to compile programs. [crarko adds: googlecl is also available from Fink, if you use that package manager instead.]

If you already have MacPorts, run the following commands in Terminal:
sudo port selfupdate
sudo port install googlecl
This will update MacPorts to the most recent release, and then fetch and build the GoogleCL utilities.

The GoogleCL project page has many example of use, including example scripts. You can also download source code from there.

A simple example of use is google contacts list name,email > contacts.csv, which will fetch your contacts list and save it to contacts.csv in the current directory.

The first time you run the google command to access information from your Google accounts, you will be asked to log into those accounts and authorize the utility for access.

[crarko adds: I tested this, and it works as described. It may take a while to build and install the packages.]
    •    
  • Currently 2.33 / 5
  You rated: 1 / 5 (27 votes cast)
 
[12,113 views]  

Install the Google command line tool | 8 comments | Create New Account
Click here to return to the 'Install the Google command line tool' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Yay!
Authored by: nathanator11 on Jun 22, '10 08:11:13AM

Excellent!
Thanks!



[ Reply to This | # ]
Install the Google command line tool
Authored by: doctype on Jun 22, '10 08:31:57AM
For the Fink Package Manager, it's:

fink selfupdate

fink install googlecl-py26 or fink install googlecl-py25

(Haven't tested it, though)

[ Reply to This | # ]
Install the Google command line tool
Authored by: Reisender on Jun 22, '10 05:26:21PM
For the Fink Package Manager, it's: fink selfupdate fink install googlecl-py26 or fink install googlecl-py25 (Haven't tested it, though)
I get this for either of those; Failed: no package found for specification 'googlecl-py26'!

[ Reply to This | # ]
Install the Google command line tool
Authored by: doctype on Jun 23, '10 07:42:50AM

Sorry, I didn't remember to check if the packages were in the "unstable" tree. They are:

http://pdb.finkproject.org/pdb/package.php/googlecl-py25
http://pdb.finkproject.org/pdb/package.php/googlecl-py26

So, you'll have to activate "unstable" (notice the consequences):

http://www.finkproject.org/faq/usage-fink.php?phpLang=en#unstable



[ Reply to This | # ]
Install the Google command line tool
Authored by: Anchang on Jun 22, '10 08:39:36AM

I didn't know it was on macports! Thanks!



[ Reply to This | # ]
MacPorts or Fink not necessary
Authored by: leamanc on Jun 22, '10 08:54:07AM

I just downloaded the source (in .tar.gz form), decompressed it, and ran the installer script according to the instructions, and it installed just fine. My system is Snow Leopard with XCode and all the latest updates installed.

mbp17:~ lcrews$ cd Downloads/googlecl-0.9.7
mbp17:googlecl-0.9.7 lcrews$ ls
INSTALL.txt			changelog
MANIFEST.in			googlecl-pylint.rc
README.config			man
README.packaging-new-releases	setup.py
README.txt			src
mbp17:googlecl-0.9.7 lcrews$ sudo python setup.py install


[ Reply to This | # ]
MacPorts or Fink not necessary
Authored by: ScottTFrazer on Jun 22, '10 09:37:34AM
I was also able to install without using macports or fink, but it gave me messages about the missing GData dependency. The steps to install that are just as simple. Download the source, then:

$ tar xzf gdata-2.0.10.tar.gz 
$ cd gdata-2.0.10
$ sudo python setup.py install


[ Reply to This | # ]
Install the Google command line tool
Authored by: karguine on Jun 22, '10 08:57:23AM
Or you can just use these two commands in terminal and get the same:
sudo easy_install googlecl
sudo easy_install gdata


[ Reply to This | # ]