GSoC/GCI Archive
Google Code-in 2014 Wikimedia Foundation

Pywikibot batch upload

completed by: murfel

mentors: Fabian, John Vandenberg

Pywikibot (PWB) is a Python-based framework to write bots for MediaWiki websites. See for more information. Patches can be submitted via Gerrit (you need a account). More documentation on Gerrit can be found at After you have successfully claimed this task in Google Melange please do use the task in Phabricator for communication instead of Google Melange. This allows more PWB developers to be reached! General development questions can be asked on the Pywikibot mailing list at and the #pywikibot IRC channel (see

Pywikibot includes a script ( which uploads a single file to a MediaWiki site.  The script consists of a class "UploadRobot" which is a 'bot', and a function main which parses command line options and invokes the bot.

This task is to extend the script so that:

  1. the class "UploadRobot" supports uploading a list of files to a MediaWiki site, and
  2. the main function allows command line options that can be used to instruct the bot to upload all files contained within a local directory using the same description for each upload file.

The Phabricator page for this task is .

To complete this task, a unit test must be added to invoke the class "UploadRobot" to upload multiple files, and the travis-ci build be successful except for unrelated breakages which might occur.  Existing upload tests can be found in  tests/ .

Students are required to read Wikimedia's general instructions at first.

Always refer to for general information and for information on specific tasks.