Page MenuHomePhabricator

Add Page.add_category() method
Open, LowPublicFeature

Description

Feature summary
Have an easy way to add a category to a page. Apparently the way to do this now is to directly modify the page text with textlib.replaceCategoryLinks() and related calls. This would be much simpler if you could just do:

page.add_category("Category name")

hiding the textlib complexity.

Event Timeline

Change 988201 had a related patch set uploaded (by Enag2000; author: Enag2000):

[pywikibot/core@master] Add unit tests for new add page method.

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

Xqt triaged this task as Low priority.Jan 8 2024, 7:16 AM
Xqt added a subscriber: binbot.

If we are doing this then maybe we should add a remove category function too?