Manual:Pywikibot/claimit.py
From Linux Web Expert
File:Git icon.svg | <translate> Wikimedia [[<tvar|1>Special:MyLanguage/Gerrit</>|Git repository]] has this file:</translate> scripts/claimit.py |
File:Pywikibot MW gear icon.svg |
<translate> Pywikibot scripts</translate> |
---|
|
· <span style="" title="<translate nowrap> Edit this template</translate>"><translate> e</translate> |
claimit.py is a script to mass add Wikidata claims to a lot of items based on pages on Wikipedia.
Concept
A category or template on Wikipedia gives information about what kind of page it is. For example if it contains a person infobox, it's probably a person. Or as another example: If a page is in a certain taxonomic family category, it's probably in that family. Based on this information you can instruct the bot to add claims.
Syntax
The bot expects a generator and pairs of property and item:
$ python pwb.py claimit <some generator> P1 Q2 P3 Q4
A concrete example:
$ python pwb.py claimit "-cat:Countries in Asia" P30 Q48