API:Client Code/Access Library Comparison

Initial microtask for Evaluating MediaWiki web API client libraries.

The Python libraries listed on API:Client_Code appear to fall in three main categories: libraries for power users and bot-writers, libraries to handle simple tasks but that don't otherwise interact with/mask the API, and libraries that have layers of abstraction to help you deal with the wiki but don't have all the features you need to write Wikipedia bots with them.

Libraries that provide layers of abstraction for the Wikimedia API:
 * Pywikipediabot - A collection of python scripts. Seems up to date (Nov 2013) (IRC)


 * mwclient - A Python library that makes most of the API functions accessible. (PyPI)


 * wikitools - Provides several layers of abstraction around the API. Should be up to date (PyPI)


 * Wikipedia - A Python library that makes it easy to access and parse data from Wikipedia. (PyPI)
 * Documentation warns not to use this for bots; does not support rate-limiting and other important features.

The following libraries do not provide any layers of abstraction for the API. They handle very simple tasks.


 * [//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
 * No usage examples
 * Includes unit tests
 * Last updated: March 2014


 * [//github.com/legoktm/supersimplemediawiki supersimplemediawiki] ([//pypi.python.org/pypi/simplemediawiki PyPI])
 * 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 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 with a more in-depth introduction to the library, giving commonly-used examples and their results, and including a separate documentation file.