Hi,
currently you can’t see the tags because this property is not retrieved. You have to
modify the APISite.usercontribs() method to get it.
https://doc.wikimedia.org/pywikibot/master/_modules/pywikibot/site/_generat…
Please create a Phabricator task for it. I think it is important enough to improve
User.contributions() as well as APISite.usercontribs().
By the way, you can use collections.Counter to simplify your code.
https://docs.python.org/3/library/collections.html?highlight=counter#collec…
Best
xqt
Am 22.05.2022 um 02:48 schrieb
i.hate.spam.mail.here(a)gmail.com:
Hi,
I have this piece of code that counts edits:
<pre>
from pywikibot import Site, User
user = User(Site("en"), input('Enter user name: '))
counts = {}
for page, oldid, ts, comment in user.contributions(9999999999999):
page.namespace()
try:
counts[str(page.namespace())] += 0
except KeyError:
counts.update({str(page.namespace()): 0})
counts[str(page.namespace())] += 1
print('Totals:')
for key in counts:
a = key.replace(':', '')
if (a == ""):
a = 'Main'
print(a + ":", counts[key])
</pre>
My question is how to see the tags in edits. It seems that .contributions() does not
return the tags.
_______________________________________________
pywikibot mailing list -- pywikibot(a)lists.wikimedia.org
To unsubscribe send an email to pywikibot-leave(a)lists.wikimedia.org