Manual:Pywikibot/illustrate wikidata.py

From MediaWiki.org
Jump to navigation Jump to search

illustrate_wikidata.py is a script to add images to Wikidata items.

Concept[edit]

On Wikimedia wiki's Extension:PageImages is installed. This adds a new page property "page_image". This bot uses that information to add a claim to Wikidata. By default P18 (image) is used, but it's also possible to add other properties as long as the property is of type commonsMedia.

Syntax[edit]

The bot expects a generator:

python illustrate_wikidata.py <some generator>

You can change the property to be add. For example to add P41 (flag image):

python illustrate_wikidata.py -property:P41 <some generator>