Thanks, Lucas. Your suggested method works, thanks again.
Lucas Werkmeister <[email protected]> 于2019年12月14日周六 上午7:13写道: > There’s no specific API for deleting a property, but the regular delete > API <https://www.mediawiki.org/wiki/API:Delete> should work – probably > pretty similar to your example code, but with title: 'Property:P10' rather > than id: 'P10'. > > Cheers, > Lucas > On 12.12.19 08:16, mosha chen wrote: > > > Hi, pywikibot experts, > I've read through this ticket( > https://www.mail-archive.com/[email protected]/msg00186.html) > for creating a new property using site._simple_request(**argv) api call, I > wonder how I can delete a property using a similar way? > for example code like this way: > params = { > 'action': 'delete', > 'id': 'P10', > 'summary': 'bot remove', > 'token': site.tokens['delete'] > } > > req = site._simple_request(**params) > results = req.submit() > print (results) > > > I've searched the actions by wikimedia API: > https://www.wikidata.org/w/api.php?action=help, It seems there's no > action for delete property, any idea? > > -- > Regards, > Mosha > > _______________________________________________ > pywikibot mailing > [email protected]https://lists.wikimedia.org/mailman/listinfo/pywikibot > > _______________________________________________ > pywikibot mailing list > [email protected] > https://lists.wikimedia.org/mailman/listinfo/pywikibot > -- Regards, Mosha
_______________________________________________ pywikibot mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot
