Skip to main content

MediaWiki API client

Project description

Logo

mwclient

Build status Test coverage Code health Latest version Downloads MIT license Documentation status Issue statistics

mwclient is a lightweight Python client library to the MediaWiki API which provides access to most API functionality. It works with Python 2.7, 3.3 and above, and supports MediaWiki 1.16 and above. For functions not available in the current MediaWiki, a MediaWikiVersionError is raised.

The current stable version 0.8.6 was released on 18 May 2017, and is available through PyPI:

$ pip install mwclient

The current development version can be installed from GitHub:

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

Please see the changelog document for a list of changes.

Getting started

See the user guide to get started using mwclient.

For more information, see the REFERENCE.md file and the documentation on the wiki.

Contributing

mwclient ships with a test suite based on pytest. Only a small part of mwclient is currently tested, but hopefully coverage will improve in the future.

The easiest way to run tests is:

$ python setup.py test

This will make an in-place build and download test dependencies locally if needed. To make tests run faster, you can use pip to do an “editable” install:

$ pip install pytest pytest-pep8 responses
$ pip install -e .
$ py.test

To run tests with different Python versions in isolated virtualenvs, you can use Tox:

$ pip install tox
$ tox

Documentation consists of both a manually compiled user guide (under docs/user) and a reference guide generated from the docstrings, using Sphinx autodoc with the napoleon extension. Documentation is built automatically on ReadTheDocs after each commit. To build documentation locally for testing, do:

$ cd docs
$ make html

When writing docstrings, try to adhere to the Google style.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mwclient-0.8.6.tar.gz (23.7 kB view details)

Uploaded Source

Built Distribution

mwclient-0.8.6-py2.py3-none-any.whl (29.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file mwclient-0.8.6.tar.gz.

File metadata

  • Download URL: mwclient-0.8.6.tar.gz
  • Upload date:
  • Size: 23.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mwclient-0.8.6.tar.gz
Algorithm Hash digest
SHA256 08f917b995b331b937ed8c7e297406e3c8d33b80234679ee7fbfeeafd7570a8e
MD5 a73687e8caa4248e9f48caece76592ff
BLAKE2b-256 cd38beaf985032b42a0b0c8f9028b469c4dcb0bd7bfab62707ec27af7e890e84

See more details on using hashes here.

File details

Details for the file mwclient-0.8.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for mwclient-0.8.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f01efd6d6765a12017cd5bc2edd55b79a5e7fbb7343e74c6a23de8a3475e2741
MD5 51114f95c964ef9de0e7aead3e54a2b7
BLAKE2b-256 2ed43d11654492c104ade0f221ecc17222ab34861c15c39df508c8c7a79b3ebe

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page