Manual:Pywikibot/harvest template.py

harvest_template.py is a script to mass add  claims based on information harvested from Wikipedia templates.

Concept
Templates on Wikipedia, especially infoboxes, contain a lot of useful information that can be used to add wd-claims>d:Wikidata:Glossary#Claims and Statements|claims to Wikidata wd-items>d:Wikidata:Glossary#Entities, Items, Properties and Queries|items.

Syntax
The bot expects a pggen>Special:MyLanguage/Manual:Pywikipediabot/pagegenerators.py|generator, the name of the template and pairs the field in the template and the wd-prop>d:Wikidata:List of properties|property to store this in. The command will look like:

This is an actual command with real values:

The bot will automatically figure out whether to parse an item property or to use a string property.

Depending on your configuration, you may need to specify which site to pull the template from. You can do this with  where XX is the language code of the wiki you want to use.