Page MenuHomePhabricator

Add tags to the wikibase functions in Pywikibot
Closed, ResolvedPublicFeature

Description

On Commons we use tags to see SDC edits. In the API this field is 'tags', see it for example at https://commons.wikimedia.org/w/api.php?action=help&recursivesubmodules=1#wbsetclaim

Add support for that in pywikibot

Example in pywikibot/site/_datasite.py

def addClaim(self,
             entity: pywikibot.page.WikibaseEntity,
             claim: pywikibot.page.Claim,
             bot: bool = True,
             summary: str | None = None,
             tags: str | None = None ) -> None:
params = {'action': 'wbsetclaim',
          'claim': json.dumps(claim.toJSON()),
          'baserevid': entity.latest_revision_id,
          'summary': summary,
          'token': self.tokens['csrf'],
          'bot': bot,
          'tags': tags,
          }

Details

Event Timeline

Multichill renamed this task from Add tags to the wikibase functions in Wikibase to Add tags to the wikibase functions in Pywikibot.Aug 14 2024, 8:21 PM

Change #1063025 had a related patch set uploaded (by Multichill; author: Multichill):

[pywikibot/core@master] Add tags to the wikibase functions in Pywikibot

https://gerrit.wikimedia.org/r/1063025

Change #1063025 merged by jenkins-bot:

[pywikibot/core@master] Add tags to the wikibase functions in Pywikibot

https://gerrit.wikimedia.org/r/1063025