Picasa uploads via command line

(The tool described here has been around for a while. This is a "memo-to-self" post, as I tend to forget a lot of things these days. {Sign of old age, maybe. Heh.})

I've been using Picasa for quite some time now, even opting for additional Google storage just so I can back up my photos "in the cloud". (Which reminds me to keep my current storage plan -- US$ 5 for 20 GB -- lest it be overtaken by the egregious Google Drive plans. But I digress...)

Unfortunately, Picasa does not offer a native uploader for Linux. (Yes, there's a Wine -- yuck! -- alternative, but it's severely outdated.) So I was stuck to using the iPhoto plugin on the Mac. Most of our photos, however, are in the Linux boxes, so it gets pretty messy sharing the albums in Mac, opening them in iPhoto, and creating new albums from there.

Enter googlecl, which exposes Google Data APIs in a command-line interface. It's written in Python, and requires Python >= 2.5, and the gdata-python-client, Google Data APIs' Python client library. Setting it up is a breeze: it's as simple as downloading and unpacking the latest tar ball, running setup.py, and adding the appropriate PYTHONPATH.

(Nifty trick alert! Download and decompress .tar.gz files using the curl | tar -xv combo.)

After that, uploading to Picasa is as easy as invoking

PYTHONPATH=~/bin/gdata-2.0.17/src:~/bin/googlecl-0.9.13/src google picasa create "Album Name" /local/path/to/album/*.jpg
During the first run, an OAuth link is displayed, which would have to be opened from a browser so googlecl will be authorized to access the Picasa account.

Since this is now in the command line, automation is possible for, say, uploading new photos once they're stored in a certain path, or running a cron job to post new photos to an album.

Comments

Popular posts from this blog

Pull files off Android phone