Manual:Pywikibot/flickrripper.py

Flickrripper is a free Python program for easy upload of large numbers of images from Flickr to Wikimedia Commons. The program is part of Pywikipedia and is currently in pre-alpha state. The tool was requested by some on Commons:Batch uploading/Flickr images by user.

Installation
Flickrripper is part of Pywikipedia. You first need to install pywikipedia. At Using the python wikipediabot you can find a manual on how to install pywikipedia. SVN install is recommended.
 * Pywikipedia

We need to install 2 more packages. For this we need setuptools. You can download the latest version at http://pypi.python.org/pypi/setuptools
 * Easy install

Python Image Library (PIL) is used to show the image. You can install it by running the command at a command prompt:
 * Python Image Library

The Python Flickrapi kit is used to communicate with the Flickr api. You can install it by running the command at a command prompt:
 * Flickrapi kit

You need a valid Flickr API key to run this program. You can apply for a key here. Apply for a Non-Commercial API Key.
 * Flickr API key

If you recently installed pywikipedia your user-config.py contains a flickr section, otherwise you have to add it to user-config.py yourself. Edit user-config.py with your favorite text editor. flickr = { 'api_key': 'YOUR_API_KEY', # Provide your key! 'review': False, # Do we use automatically make our uploads reviewed? (True or False) 'reviewer': 'REVIEWER_NAME', # If so, under what reviewer name? }
 * Configuration
 * 1) Using the Flickr api
 * api_key : Provide your Flickr API key.
 * review : If you want to mark all images as review automatically. Use "True" only if you have a reviewer or sysop flag on Commons!
 * reviewer : Add your username here if you want to mark images as reviewed by you.

Usage
To run Flickrripper you have to browse to the Pywikipedia folder. Then type the following:

You are presented with various options:
 * Options to tell what images to work on:
 * -group_id - The id of the Flickr group to work on. Works on all images in a group
 * -photoset_id - The id of the Flickr set to work on. Works on all images in a set
 * -user_id - The id of the user to work. Works on all images uploaded by a user
 * -start_id - Start at the photo with this id (useful for resuming uploads). Use this in combination with -group_id/-photoset_id/-user_id
 * -end_id - Stop at the photo with this id (useful if you just want to do a part of the upload and later resume with -start_id)
 * Options to tell how to work on each image:
 * -tags - Filter out a certain tag (only one at the moment, will be changed to support multiple tags).
 * -flickrreview - Mark as flickrreviewed, this overrides the settings in your user-config.py
 * -review - Set the reviewer for flickrreview, this overrides the settings in your user-config.py
 * -override - Remove the licensing part and replace it with something custom. Can be used for transfering copyrighted photo's for which you have OTRS permission. Use with care!
 * -removecategories - Remove the suggested categories
 * -addcategory - Manually add a category (will be changed to support multiple categories)

Syntax:

Troubleshooting
Traceback (most recent call last): File "flickrripper.py", line 41, in    from PIL import Image, ImageTk    # see: http://www.pythonware.com/products/pil/ ImportError: No module named PIL

You can fix this by manually PIL installation (not by easy_install).

Todo

 * 1) Username Currently user_id can't fetch via the Username. For example, for http://www.flickr.com/photos/library_of_congress/, the user can't just enter "The Library of Congress". He or she has to go to http://www.flickr.com/services/api/explore/?method=flickr.people.findByUsername and enter "The Library of Congress" which gives the user_id as 8623220@N02, which then could be entered in the user_id . This should be done automatically.--Diaa abdelmoneim ( talk ) 17:59, 17 September 2009 (UTC)
 * 2) Collections Allow uploading via collections like via sets.--Diaa abdelmoneim ( talk ) 14:41, 18 September 2009 (UTC)
 * 3) In the case that the file has no name, but is in a set, name it after the set.--Diaa abdelmoneim ( talk ) 15:22, 27 May 2010 (UTC)