flickrlib 0.5

This is a Python library that works with the Flickr API. There are a few other ones out there, like Beej’s and FlickrClient. I used both to come up with my own. Unlike the other libraries this one uses XML-RPC, that’s not necessarily good but I just thought it fit better in to Python since XML-RPC is part of the standard python library. The format that the API functions return is a nested dictionary, it might change later to something more palatable.
Other features include a streamlined authentication process and an integrated upload method.
The library currently lacks a custom error class and it is not thread safe, and when I say that I mean it will do crazy stuff if you don’t put mutex locks around calls to this library.
Anyway, this whole library came to be because I am working on a Flickr client that I will be releasing shortly. Here is how it works:

>>> agent = flickrlib.FlickrAgent(flickr_api_key,flickr_ssecret)
>>> agent.flickr.people.findByUsername(username='amanda')
{u'id': u'35237103548@N01',
 u'nsid': u'35237103548@N01',
 u'text': u'',
 u'type': u'user',
 u'username': [{u'text': u'Amanda', u'type': u'username'}]}

You could get it here.

flickrlib 0.5

8 thoughts on “flickrlib 0.5

  1. I’ve tried to use this lib and got the following error:

    >>>agent._upload({‘filename’:r’c:tempDSC_6500~1.jpg’, ‘title’:’test’})
    ‘nntnn’

    The key and shared was set correctly. I believe.

  2. shellreef says:

    Great work – I’ve tried the three other Python Flickr API libraries but yours is the most intuitive. Thanks!

  3. juanvi says:

    Very intuitive to use. Great work!

    As a piece of advice, if any of you find problems with codification change line 107 from om=xml.dom.minidom.parseString(xmlStr.strip()) to om=xml.dom.minidom.parseString(xmlStr.strip().encode(‘utf8’))

    Unfortunately, I do not know if this line would work under any circumstances, but it is working for me!

    To test this library, I’ve developed an automatic tool to automatically change the KDE background using Flickr. You can find it under the GPL in http://globus.upc.es/~juanvvc/downloads/desktop-flickr-0.99.tar.gz

    Thanks again!

  4. David Donovan says:

    I’m having problems with the flickr.photosets.getPhotos() method. When I try to use the optional page parameter to get the second page of results (flickr limits the page to 500 pix in a photoset), it simply returns the 1st page again. Any suggestions? Is this an issue with the api or with the flickrlib implementation? –Cheers

  5. B says:

    Thanks for the great work!
    I’m having a problem with flickr.photos.getAllContexts and any photo in a pool. I can use the method to get info on photos not in a pool, but when a photo is in one, it throws:
    xml.parsers.expat.ExpatError: junk after document element

Comments are closed.