The examples in demo*.py are not immediately noticeable when looking at the project, and the lack of a continuation example in the README initially drove me away from using this library in my own project. I suggest to add a continuation example to the README file.
Also I don't really like the way MediaWiki returns results nested inside ['query']['pages'], and if there is no pages, it will skip these fields altogether in the result, instead of returning an empty collection. That makes the code less elegant. I'm not sure what would be the most pythonic way to handle this, but for now I think this example may provide some starting point.
Moreover, if not using formatversion=2 it will return each page as a dict key instead of a list, so I prefer using formatversion=2.
The examples in
demo*.py
are not immediately noticeable when looking at the project, and the lack of a continuation example in the README initially drove me away from using this library in my own project. I suggest to add a continuation example to the README file.Also I don't really like the way MediaWiki returns results nested inside
['query']['pages']
, and if there is no pages, it will skip these fields altogether in the result, instead of returning an empty collection. That makes the code less elegant. I'm not sure what would be the most pythonic way to handle this, but for now I think this example may provide some starting point.Moreover, if not using
formatversion=2
it will return each page as a dict key instead of a list, so I prefer usingformatversion=2
.