skip to navigation
skip to content

mw-api-client 3.0.0a2

A simple MediaWiki client.

A really simple MediaWiki API client.

Can use most MediaWiki API modules.

Requires the requests library.


To install the latest stable version:

pip install -U mw-api-client

To install the latest development version:

git clone
cd mw-api-client
pip install -e .

Example Usage

import mw_api_client as mw

Get a page:

wp = mw.Wiki("", "MyCoolBot/0.0.0")

wp.login("kenny2wiki", password)

sandbox ="User:Kenny2wiki/sandbox")

Edit page:

# Get the page
contents =

# Change
contents += "\n This is a test!"
summary = "Made a test edit"

# Submit
sandbox.edit(contents, summary)

List pages in category:

for page in wp.category("Redirects").categorymembers():

Remove all uses of a template:

stub = wp.template("Stub")

# Pages that transclude stub, main namespace only
target_pages = list(stub.transclusions(namespace=0))

# Sort by title because it's prettier that way
target_pages.sort(key=lambda p: p.title)

for page in target_pages:
    page.replace("{{stub}}", "")

Patrol all recent changes in the Help namespace:

rcs = wp.recentchanges(namespace=12)

for rc in rcs:

Made by Kenny2github, based off of ~blob8108’s Scratch Wiki API client.

MIT Licensed.

File Type Py Version Uploaded on Size
mw-api-client-3.0.0a2.tar.gz (md5) Source 2018-03-19 17KB
mw_api_client-3.0.0a2-py2.py3-none-any.whl (md5) Python Wheel py2.py3 2018-03-19 21KB