API:Client Code/Access Library Comparison

Initial microtask for Evaluating MediaWiki web API client libraries.

The Python libraries listed on API:Client Code fall into two groups: libraries that offer a layer of abstraction that makes it easy for programmers to take advantage of the internal structure of the Mediawiki instance, and simple API wrappers that handle functions like logging in and cookies but do not otherwise mask the API structure.

Libraries that provide layers of abstraction over the Mediawiki API:

 * Pywikipediabot (IRC)
 * [//github.com/mwclient/mwclient mwclient] ([//pypi.python.org/pypi/mwclient/ PyPI])
 * wikitools ([//pypi.python.org/pypi/wikitools PyPI])
 * Wikipedia (PyPI)
 * Documentation warns not to use this for bots; does not support rate-limiting and other important features.

No-abstraction libraries for the Mediawiki API:

 * [//github.com/ianweller/python-simplemediawiki simplemediawiki] ([//pypi.python.org/pypi/simplemediawiki PyPI])
 * Handles cookies, login
 * Requires Python 2.6+ or 3.3+
 * Includes a documentation build configuration file, but no separate documentation
 * Provides usage examples in comments
 * Includes unit tests
 * Last updated: March 2014


 * [//github.com/legoktm/supersimplemediawiki supersimplemediawiki]
 * Handles login, cookies, get, post, and API calls
 * Python 2.6-3.3 compatible
 * Has an example script, but no other documentation.
 * No tests provided
 * Last updated: Nov 2013


 * [//github.com/yuvipanda/python-mwapi python-mwapi] ([//pypi.python.org/pypi/python-mwapi PyPI])
 * Handles login, get, post
 * Minimal documentation; no usage examples provided
 * No tests provided
 * Last updated: Dec 2012

The functionality of these three basic implementations has not yet been compared. However, simplemediawiki is the only one actively maintained (as of March 2014) and is now compatible with Python 3. It is the best documented and is the only one to include unit tests; these should aid troubleshooting. The documentation could be improved by writing a more in-depth introduction to the library, adding commonly-used code samples and their results, and including a separate documentation file. Simplemediawiki appears to be the most user-friendly of the no-abstraction libraries.