Iterate through all articles in a Wiki

12 views
Skip to first unread message

Ben

unread,
Jan 22, 2012, 10:09:54 PM1/22/12
to mwlib
Hi, I'm new to using mwlib so forgive me if my question is very
simple. I've searched the documentation and Googled a lot but not
found anything so far.

I am trying to use Python and mwlib to parse articles. So far I have
something that parses the tree produced by
"env.wiki.getParsedArticle("Foo")"
But I want to iterate through all articles.

Ideally I'd have a list of all articles and then split it into chunks
to process in parallel.

Is there something in mwlib to help with this?

Ben Humphreys

Volker Haas

unread,
Feb 2, 2012, 4:59:05 AM2/2/12
to mw...@googlegroups.com
Hi Ben,

the "metabook" object contains the outline of the collection.
Iterating over all articles in a zip file can be done with env.metabook.walk(). The items are (hopefully) self-explanatory dictionaries.

Regards,
Volker


Reply all
Reply to author
Forward
0 new messages