views:

535

answers:

1

How would you query Picasa from a Google App Engine app? Data API or Url Fetch? What are the pros and cons of using either method?

[Edit]
I would like to be able to query a specific album in Picasa and list all the photos in it. Code examples to do this in python are much appreciated.

A: 

Your question is a little off, since the Data API is exposed through RESTful URLs, so both methods are ultimately a "URL Fetch".

The Data API works quite well, though. It gives you access to nearly all the functionality of Picasa, and responses are sent back and forth in well-formed, well-documented XML. Google's documentation for the API is very good.

If you only need access to limited publicly available content (like a photostream) then you can do this at a very basic level by just fetching the feed url and parsing that... but even for that you can get the same data with more configuration options via the Data API URLs.

I'm not sure what code samples you'd like... it really depends what you actually want to do with Picasa.

Gabriel Hurley
I guess my mis-understanding might be that I thought the Data API had a specific Python Library I could use, and the URL Fetch was just me building a URL to call. Also, thanks for the comment about what I want to *do* with Picasa. I totally didn't think about it.
Ryan Montgomery
Ah, gotcha. Yeah, there is a GData Python Library. I've used it, and will say that it works, but it's not feature-complete and still has definite bugs. It handles things like authentication for you, which is really handy, and it also provides you access to ALL of the GData APIs including Picasa, Youtube, Blogger, and all of Google's other services. You'd really have to give it a try and see if it works for you. The docs for the python library are here: http://code.google.com/apis/gdata/articles/python_client_lib.html
Gabriel Hurley
In the end, though, the python library is just constructing URL calls and parsing XML responses, though, just FYI.
Gabriel Hurley