Skip to content
Snippets Groups Projects
README.rst 2.77 KiB

mwclient

Mwclient is a client to the MediaWiki API which provides access to most API functionality. It depends heavily on Bob Ippolito's SimpleJSON, requires Python 2.4 and supports MediaWiki 1.11 and above. For functions not available in the current MediaWiki, a MediaWikiVersionError is raised.

This framework was written by Bryan Tong Minh, who released the latest stable version 0.6.5 on 6 May 2011. The current development version can be installed directly off github:

$ pip install git+git://github.com/btongminh/mwclient.git

Please see the release notes for a list of changes.

Implementation notes

Most properties and generators accept the same parameters as the API, without their two-letter prefix. Exceptions to this rule:

  • Image.imageinfo is the imageinfo of the latest image. Earlier versions can be fetched using imagehistory()
  • Site.all*: parameter [ap]from renamed to start
  • categorymembers is implemented as Category.members
  • deletedrevs is deletedrevisions
  • usercontribs is usercontributions
  • First parameters of search and usercontributions are search and user respectively

Properties and generators are implemented as Python generators. Their limit parameter is only an indication of the number of items in one chunk. It is not the total limit. Doing list(generator(limit = limit)) will return ALL items of generator, and not be limited by the limit value. Default chunk size is generally the maximum chunk size.