Manual:Pywikibot/Compat/picasacopier.py

From Linux Web Expert

Picasa copier is a free Python program for easy upload of large numbers of public images from Picasa (Google web albums) to Wikimedia Commons. The program is part of Pywikipedia and is currently in verification state[1].

Installation

Pywikipedia

Picasacopier 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.

Easy install

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

Python Image Library

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

easy_install PIL
Google Data API kit

The Google data api kit is used to communicate with the Picasa web album api. (see Installing Google Data API Python Library)

Usage

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

python picasacopier.py

You are presented with various options:

Options to tell what images to work on:
  1. -user_id - The id of the picasa web album user to work. Works on all public images uploaded by a user. (e.g. if your email is 'test@gmail.com', your User ID is 'test')
  2. -album_id - The id of the Picasa web album. (look here finding web album id number)
Options to tell how to work on each image:
  1. -picasareview - Mark as picasareviewed
  2. -reviewer - Set the reviewer for picasareview
  3. -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!
  4. -removecategories - Remove the suggested categories
  5. -addcategory - Manually add a category (will be supporting multiple categories)
  6. -autonomous - For autonomous uploading without showing of each image. Use with care!

Syntax:

python picasacopier.py -user_id:test -removecategories -addcategory:<category name>

Troubleshooting

Traceback (most recent call last):
  File "picasacopier.py", line 371, in <module>
    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 (Archived 2012-04-02 at WebCite) (not by easy_install).

See also

Picasa Web Albums Data API Developer's Guide