Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Python to read images from a www.flickr.com account

Tags:

python

flickr

Ok, so I need to build this application where I'll read images from a www.flickr.com account and use the images in my Python app. How will I do that? Any ideas? Thanks.

like image 550
Gooner Avatar asked Jul 20 '26 16:07

Gooner


1 Answers

You could use one of the various flickr python libraries :

  • http://code.google.com/p/flickrpy/
  • http://pypi.python.org/pypi/Flickr.API/
  • http://stuvel.eu/projects/flickrapi

And for a good overview of flickr API, always look at the docs: http://www.flickr.com/services/api/

An example:

import flickrapi
api_key = 'API KEY YYYYYYYYYY' # you will need a key
api_password = 'your secret'
flickrClient = flickrapi.FlickrAPI(api_key, api_password)
# now you could use the methods on this client
# flickrClient.methodname(param)
favourites = flickrClient.favorites_getPublicList(user_id='userid')
# Get the title of the photos
for photo in favourites.photos[0].photo:
    print photo['title']

[Edit:]

For authentication look at : http://stuvel.eu/flickrapi/documentation/#authentication

like image 138
pyfunc Avatar answered Jul 22 '26 07:07

pyfunc