MediaWiki API client
Project description
mwclient
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.9.1 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 the 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 the 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 usingimagehistory()
Site.all*
: parameter[ap]from
renamed tostart
categorymembers
is implemented asCategory.members
deletedrevs
isdeletedrevisions
usercontribs
isusercontributions
- First parameters of
search
andusercontributions
aresearch
anduser
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mwclient-0.9.1.tar.gz
.
File metadata
- Download URL: mwclient-0.9.1.tar.gz
- Upload date:
- Size: 35.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.7 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed7a0eeb98f0309946ae8762b60eae10eb507e4b67400931ec24abd0aee3d7b4 |
|
MD5 | b9fc00d68dbf4a3db4ca476d438d6b57 |
|
BLAKE2b-256 | 1b9bc790760100c336e596b99ad13537fda36c13ea6f289b88594e9ad0d90a1e |
File details
Details for the file mwclient-0.9.1-py2.py3-none-any.whl
.
File metadata
- Download URL: mwclient-0.9.1-py2.py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.13.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.7 CPython/3.6.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10d318b36f1f38c3d480ab95450514054a9b7b2d00315cac4f97d096284b17e3 |
|
MD5 | 8d4010ccde4b3d3fae9595c4a7515f5a |
|
BLAKE2b-256 | 1df92bf5562aba1f5e4f30687817e57ac853643b05bd4fc9fd44b21dc8945d7a |