mediawiki-utilities / python-mwapi

Simple Python Wrapper around MediaWiki API
http://pythonhosted.org/mwapi
MIT License
31 stars 11 forks source link

Add a continuation example to README #40

Closed yurkobb closed 5 years ago

yurkobb commented 5 years ago

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.

halfak commented 5 years ago

This looks great. Thank you!