mediawikipywikibotwikimedia-commons

Testing image uploads in Wikimedia Commons


I want to use pywikibot to upload a batch of images into Wikimedia Commons. However, when you add images in Commons, you can't easily delete them if you made a mistake. Is there a way to locally install Wikimedia Commons for validation and testing ?

I tried installing mediawiki, but I can't seem to upload images using pywikibot.

Is there some specific procedure to do that?


Solution

  • Way more effort than just uploading and saying sorry if it goes wrong (just don't do batch operations until you are reasonably confident the script works; also see Guide to batch uploading and bot requests if you haven't yet). Also, licensing tends to be just as easy to get wrong as the technology; if you are not sure about what you are doing, ask first.

    You can also use the test wiki for testing the bot (but no mass uploads please, just a few test files). Note it does not support structured data in image descriptions, unlike Commons. (There is a Commons test wiki but not for long.)

    If you want to install a local MediWiki anyway, the mediawiki package is the easiest way (it will be dissimilar from Commons in a number of ways, but most of them probably don't matter much), make sure it is properly configured for uploading (not sure if the Debian package does that out of the box), then generate a wiki family for pywikipediabot.