[13:23:10] [telegram] hello! Is there a way to list all the subcategories in a category? [13:24:46] [telegram] You mean subcategories of any level? (subcategories, subcategories of subcategories and so on) (re @Galder: hello! Is there a way to list all the subcategories in a category?) [13:25:10] [telegram] first level only [13:25:21] [telegram] I can get a list of 200 but I need all of them [13:25:42] [telegram] I'm trying with listpages.py but I can't get categories [13:25:49] [telegram] Then through Quarry [13:26:13] [telegram] Which exact category do you need? [13:26:14] [telegram] https://en.wikipedia.org/w/api.php?action=query&list=categorymembers&cmtitle=Category%3ALists&cmtype=subcat&cmlimit=max&formatversion=2 would be my approach [13:26:20] [telegram] and follow API continuation if necessary [13:27:09] [telegram] https://eu.wikipedia.org/wiki/Kategoria:Txantiloietan_erabiltzeko_txantiloiak [13:27:34] [telegram] e.g. using https://github.com/mediawiki-utilities/python-mwapi/blob/37155d45e40065dbd562b7b9f35f332db6fff824/mwapi/session.py#L293-L295 for the Python mwapi library (re @lucaswerkmeister: and follow API continuation if necessary) [13:31:06] [telegram] https://tools-static.wmflabs.org/bridgebot/4f921ee3/subcats.txt [13:31:07] [telegram] https://tools-static.wmflabs.org/bridgebot/5d81a858/subcats.py [13:31:19] [telegram] great! [13:31:20] [telegram] (12191 subcategories) [13:31:33] [telegram] (12180 must be deleted) [13:31:40] [telegram] oof [13:32:11] [telegram] does that mean I can expect to see a large QuickCategories batch soon ;) [13:32:41] [telegram] no, I'll do it with MassDelete [13:33:39] [telegram] oh, fully deleted, okay [13:33:45] [telegram] good luck! [13:34:26] [telegram] yes, those were part of the ancient automatic taxoboxes, which created categories based on templates. Now that we are fully Wikidata, those are empty and redundant. So better if we delete them [13:36:05] [telegram] Other method: https://quarry.wmflabs.org/query/51040 (re @Galder: https://eu.wikipedia.org/wiki/Kategoria:Txantiloietan_erabiltzeko_txantiloiak) [13:37:22] [telegram] both are great! Thanks! Deletion is in process [13:38:53] [telegram] MassDelete is quite curious: it works faster if you are looking at it [13:46:49] [telegram] I see I'm already too late, but: [13:46:49] [telegram] Galder I think this should work: python3 pwb.py delete -subcats:"Txantiloietan erabiltzeko txantiloiak" -ns:Category [13:49:23] [telegram] but I didn't want to delete everyone [13:50:08] [telegram] ah, my math was bad. I thought you wanted to delete everything except 1, i see that it's everything except 11 [17:39:02] [telegram] Thats a standard generator in pywikibot. Just use -subcats: . You can see a list of generators at https://doc.wikimedia.org/pywikibot/master/_modules/pywikibot/pagegenerators.html (re @Galder: hello! Is there a way to list all the subcategories in a category?) [17:47:49] [telegram] But I wanted the list of subcats itself [17:51:46] [telegram] Yeah, that's what -subcats does. -catr is for working on pages in subcategories. And yes, i agree it's confusing 😉 (re @Galder: But I wanted the list of subcats itself) [18:19:26] [telegram] One of the reasons why I prefer to write my own bots. Ways simpler than learning how to use pywikibot 🙈 [19:12:16] [telegram] you can write your own bots useing pywikibot [19:17:40] [telegram] True enough, but that is like hammering a nail with a microscope. Much easier to go to [[Special:ApiSandbox]] figure out the appropriate API module and then utilise some API wrapper to make use of it. [19:18:16] [telegram] it's true that scripts make more sense when you use them more then just once.... [19:18:38] [telegram] the "hammering a nail with a microscope" sounds familiar 😉 [19:19:02] [telegram] my motto is: while writing the script is fun, it makes sense doing it